Everybody who has used Tableau for a while has come to love swapping measures by using a parameter. In fact, that is a feature I often utilize to make better use of space on a dashboard and to save time as it allows you to analyse several measures in one area. If you aren’t familiar with the technique, this Tableau Knowledge Base article is a good place to start.
Parameter Actions in the Tableau Toolbox
When I heard that Tableau would finally be adding parameter actions to its Toolbox, i.e. the value of a parameter being driven by a user selection on a dashboard, I got very excited. This new feature would finally make that drop-down menu (where you select a measure to be displayed on the dashboard) obsolete.
One of the issues I always had with the drop-down menu on top of a dashboard was that you don’t see all the possible measure selections at a glance because the others are hidden in the menu. A second issue is that it is hard to make the user aware of which charts will be influenced by the selection.
I will now show how you can change the measure you analyse on your dashboard by just clicking a KPI box rather than selecting from a drop-down menu—I consider this to be the best use case for parameter actions I’ve encountered so far.
1. Create a Parameter containing the Measure names and a Variable Measure (as shown in the Knowledge Base article):
2. Create a calculated field for each Measure in the parameter containing its number (e.g. if Sales is 1 in your parameter, create a calculated field that contains only 1) and turn them into a measure.
Note: You can also use words for your KPIs both in the parameter and the selection fields. Personally, I prefer integers as they give you some more flexibility and remove the possibility of having typos in your words.
3. Create a KPI Box for each Measure and add the respective calculated field to that KPI Box:
4. Place KPI boxes on the dashboard:
5. Create the parameter actions that drive the measure selection. In case you are using an integer parameter like I am, make sure you do not aggregate your Parameter Value calculated field. We just need the actual value of the field that we typed in before:
6. That’s it. Your parameter action now drives the value of the variable measure created before:
I have created an example on Tableau Public that you can download and explore: