Hey everyone, for this blog, I want to share with you how to use parameter and “Case” function in Tableau, which is sometimes very useful when you want to see the same measures for different dimensions.

For example, in the 3 Tableau worksheets below (data is from superstore data), I have Sales by Segment, Category, and Ship Mode. In this case, ideally we should combine all 3 in 1 worksheet because they just basically look at Sales number, and also we can save some space for other worksheets as well when we build our dashboard.

To do that, first step, we need to create a parameter:

Then, put in the name of the parameter, followed by changing the type of the data to string. Then, we put the values as a list and type in Segment, Category, and Ship Mode.

After that, click OK and you can see the parameter we’ve just created at the bottom on the left here.

Next step is to create a calculated field in which we will use the case function:

Name the calculation, type in the statement as shown in the pic below and click OK. Tips: if you don’t remember exactly how to write the statement, you can search for it by clicking on the tiny arrow on the right side of the calculated field window, where we can find all functions in Tableau.

Now, click on the arrow of the parameter and choose “Show Parameter”

Drag in the calculated field that you’ve just created, mine is Sales by, onto Rows, then drag Sales to Columns. And on the right, you can see our parameter there where we can choose either Segment or Category or Ship Mode to look at.

Tips to have dynamic title: as you click on edit title of the sheet, click insert then choose “Parameters.Choose Options”.

 

Now, as you choose different options to look at, the title will be changed dynamically according to the option that you choose.

I hope you find my blogs with some tips useful. See you next time!

Sammy Do
Author: Sammy Do

Data Analytics Consultant who loves visualising data and driving meaningful insights