Tableau Tips : Sorting By Measure

In the last article under tableau tips we learnt how to give user the choice to select sort order. Today we will discuss yet another sorting feature using parameter. We will today see how to sort the dimension based on a measure. Lets say that we have multiple measures on out worksheet as under:
In the above table we see that the result is sorted alphabetically by Sub Category names. If we would like to sort the table on a specific measure we can simply click on the measure and then sort it , but what about the end user . One way is that he can hover around the measure and click on the sort icon. But many wont be aware of it. Instead we can use the power of parameters and give the end user the choice to select the measure by which he wants to sort the table. Here i show to achieve it .
Create a parameter that enables us to select the measure on which we want to sort as under:
Once we have created a parameter create a calculated field that can be used for the sort as under:
Now right click on the Sub Category dimension on the Rows pane and click on Sort.
In the pop up window that appears, select the dimension Which Measure that we have created as under:

That’s all that we need to do. Click on the parameter that we created and select show parameter control. You can now choose a measure from the dropdown and the table would be sorted accordingly .
Here’s the workbook that demonstrates the above :

Hope you guys enjoyed it and found this to be helpful.

Rahul Singh

Please follow and like us: