Being able to toggle between dimensions or measures in Tableau is a nice feature to have when building a story for users or just on the dashboard. Being able to give the user the ability to do this is easy and can be done in a couple of steps.
The first step to creating a toggle is to “Create Parameter…” in Tableau by right clicking on the left side of the program:
To create the parameter here you have to change the data type to String and allowable values to list. Once you’re done with that you can type in the names of the values. For this example I simply just typed the name of two measures in the data set seen below:
After selecting “OK” you will see that the parameter is created. The next thing that is needed is to create a “Calculated Field…”, where you will write a CASE statement to toggle between the fields in the list you have created. Once you are finished creating the “Calculated Field…” drag that column into your report.
The final step to completing this is to create a filtering drop down so you can control the which field is being displayed in the report. Once that is completed you can begin filtering between fields.
Below is an example of how the filters will function. Please feel free to contact us if you have any questions.