Sitemap

Custom Drop-Down menu in Tableau

5 min readAug 20, 2024

--

Back in the day, when I was seeing the default drop-down list on my viz compare to other custom button I made — it is a bit lame, isn’t it? Here

Press enter or click to view image in full size

Do you see my point? There are six buttons beautifully made in a lilac round shape, yet the dropdown makes them look like they don’t harmonize well.

So, here the expected custom drop-down list that I would like to make:

The steps:

  1. Create a parameter of the drop down list
Press enter or click to view image in full size

Values are populated statically from other dimension called Campaign

2. Create a new sheet named ‘btn_drop down’

Press enter or click to view image in full size

I’ve prepared the background button as below and put them into folder Shapes under My Tableau Repository

Press enter or click to view image in full size

Then create a new parameter named ‘p_switch parameter’ to determine which shape or background-button would be displayed accordingly to its value

Press enter or click to view image in full size

Then create a new calculation field named ‘c_switch calc’

Press enter or click to view image in full size

The idea of making a calculation field named ‘c_switch calc’ is to use this field to distinguish the the used button.

Change the Mark Type from Automatic into Shape

Press enter or click to view image in full size

Then pull the ‘c_switch calc’ into Shape

After reload the shape, the new button will be displayed and ready to use.

An “Entire View” is chosen, then set up the background-button for “False”

Press enter or click to view image in full size

It looks like this after clicking OK

Press enter or click to view image in full size

for “True”, the setup will be like this

Press enter or click to view image in full size

3. Create a new sheet named “list_drop down”, this sheet will consist all the values of the parameter created earlier on step #1

Press enter or click to view image in full size

Then create a new calculated field named “c_campaign_calc” with the logic as follows

Press enter or click to view image in full size

This logic will have Boolean data type based on the condition. This field will be used to coloring the active campaign on drop-down list

Get Yeni W’s stories in your inbox

Join Medium for free to get updates from this writer.

Then a create new calculated field named ‘c_switch opposite’ as below

Press enter or click to view image in full size

This field will give an opposite value of p_switch parameter

On this sheet, Bar is chosen on Marks Type

Press enter or click to view image in full size
  • Re-color the list using #aeb4f6 and #474de4 as follows
  • Update font-color into white
  • Maximize the size on Marks Card to avoid white space between the option list
Press enter or click to view image in full size

4. Create a new sheet named “blank_drop down”. This sheet is gonna be put on top of another sheet for parameter action

Press enter or click to view image in full size
  • put c_switch calc and c_switch opposite on the detail marks
  • choose the Shape on Marks Type
  • Maximize the size on the Marks Card
  • Ensure to put None on everything at Format Border and Format Line to avoid any line would show up

4. Back on the dashboard, setup up the new custom drop-down list will begin by

  • Drag the sheet btn_drop down onto the dashboard using floating layout
  • Create Text Object which contains value of the p_campaign
Press enter or click to view image in full size

put the text object on top of the background-button

  • put ‘list_drop down’ sheet under the button as follows
  • put ‘blank_drop down’ sheet on top of the text object

Ensure to remove the worksheet color (background color) to None and resize the sheet until fit in with text object.

5. On the final step, let’s compose some action towards the drop down list:

  • Go to Action at Dashboard Menu, then Add Action >> Change Parameter, setup the value as follows, click OK
Press enter or click to view image in full size
  • setup another parameter action named ‘p_switch toggle’. There are two sheets as the source which are blank_drop down and list_drop down, target parameter is p_switch parameter, and the source field come from c_switch opposite
Press enter or click to view image in full size

Here the final look:

Press enter or click to view image in full size

Further exploration can be performed at my viz : Digital Ads Performance Dashboard

--

--