Remove the SUM(Profit), SUM(Revenue) and SUM(Sales) from Rows. Add Measure Names to Columns and add Measure Values to the Text portion of the Marks instead. You should then be able to sort on whatever measure you want.
Right-click on the Name field -> Sort and select to sort Descending (or Ascending, depending on preference) and select the radio button next to Field. Select the measure you want to sort on.
The more items you add to the rows shelf adds more to the level of detail, so what Tableau is doing is sorting within that subset of Name and Order Date.
Hopefully that makes sense.
I understand what you want to tell me, but an example: maybe one stakeholder wanted to sort the profit and an other want to sort the revenue. If i do it like that the user does not have any option to choose which one he wanted to sort you know what i mean.
For me it makes no sense if you look for example in a database there you can sort anytime and it does not matter how many measures or dimensions you have.
1 of 1 people found this helpful
In this case, you may want to use a parameter for sorting, as clicking column headers with more than one item in Rows isn't going to get you what you are expecting.
- Create a new parameter and call it "Sort by".
- Set the type to be String, pick List as the "Allowable Values" and set the choices to be "Profit", "Revenue" and "Sales", all as their own choice.
- Right-click on the newly created parameter and choose "Show Parameter Control"
- Create a new calculated field called "Sort Selection"
- Put the following in as the calculated field:
CASE [Sort by]
WHEN 'Profit' THEN SUM([Profit])
WHEN 'Revenue' THEN SUM([Revenue])
WHEN 'Sales' THEN SUM([Sales])
- Right-click on Name in the Rows Shelf -> Sort.
- Set the Field to be Sort Selection
- You should be able to control the sort using the parameter dropdown now.
Thats kinda what i wanted to build. It's not the smartest and best looking solution for that, but it works.
So thank you very much.