If you have read part one, then you already know how to build a dynamic axis, and, in this post,  I will explain you how to create a parameter to let your user sort between ascending descending. I recommend you that if you haven’t read about how to create a dynamic axis, you can read about it here as I will build upon that post.

Why would you need a parameter to sort?

  1. The sorting option is hard to find and if a user is not used to Tableau it will probably won’t find the option. 
  2. It is a much nicer way to sort.

Creating a parameter-controlled sort

Step 1: Create the parameter as a list with Ascending/Descending

Right now, your dynamic axis calculation looks as following (mainly for the people that haven’t read the first part):

Step 2: Now you will have to mix your Select Measure parameter with your Ascending/Descending parameter. The trick consists on creating a calculated field that has both positive and negative values of your current measures. To achieve this, you will have to create six different outcomes instead of just three, combined with AND.

Step 3: Select your Sorting field previously created as the selected sort of your dimension (in this case Segment).

Step 4: Show your parameter control and you are ready to go!

If you have any doubts or comments, feel free to use the box below or contact me in Twitter @DiegoTParker