Reputation: 21
I have this dashboard and I want to show the top 15 stations on current year (2018) for delays/departures.
If I have the sort in the Columns, it sorts in the correct order, but it shows all of the stations.
If I put the Station in the filter for top 15, it somehow gets sorted incorrectly.
My formulas are 2018 rank = if [Year] = 2018 then [Delay Measure] else 0 end 2018 ranks = [2018 rank]/departures_count
Upvotes: 2
Views: 1180
Reputation: 11896
Make [Month] a context filter, by right clicking on it on the filter shelf and choosing “Add to Context”
Then Tableau will first apply the [Month] filter and then apply the top 15 stations filter upon those results. Otherwise, the filters are independent and you are filtering to the top 15 stations over all months, then just showing the data for a selected month.
Upvotes: 2
Reputation: 1311
You're nearly there, you need to combine approaches
Firstly you filter to get the top N from the column pill Station. So click --> Filter --> Top N field
Then once you have done that you'll only be showing the top n results in your report
Next we can sort these top 15:
Click on column pill --> Sort --> Descending --> Your sorting field
Instead of choosing a number to filter the number of stations, it's a nice idea to give users the option by using a parameter. Then in the Top N you can change it to your newly created integer parameter:
Upvotes: 0