Search
  • Robert Breen

Dynamic sort in Tableau Desktop

Updated: May 10



Are you looking to dynamically sort your view by a parameter value? You've come to the right place. Here's how to sort by a measure using a parameter selector.


In this video, I'm going to show you how to create a dynamic sort within Tableau. On the left hand side I have the original view sorted high to low. On the right hand side, I have a user selection of high to low or low to high.


1. First I'll need to add state then sales.

2. second I'll need to create a parameter. I'm going to call it sort parameter

3. Make it a string and a list the values will be high to low and low to high

4. Now I wanted to create a calculated field called sort example

5. Case statement case parameter example when high to low then negative sum of sales when low to high then sum of sales end

6. Now I'm going to put that example on rows make it discrete and put it in front of state. It sorts high to low if i add the parameter i can now choose low to high hide this header and remove dividers

7. That's it!



Robert Breen


Interested in more blogs about parameters?

Check out this blog post about setting a default parameter value.

Or this post. Use Parameter Actions to Control Date Level.





12 views0 comments