Hello
I'm kind of new to Tableau and trying figure out how this works. I'm trying find out the Top 5 of Sales by years. If I create the a set using Top 5, the result will show correctly when I don't filter the years, as below.
However, if I try to find out the result by years, the Top N set will not work because it is only showing the Top 5 from total but not by year.
Is there any way to do this correctly? I tried to use the Rank function to do this, but I was not able to get the correct sum of Top 5 by years using Rank function.
I've attached the work file (I used the superstore data as an example).
Any insight would be much appreciate! Thank you!
Putting your Year filter into Context should resolve this.
Very useful article on the order things happen within Tableau: Tableau's Order of Operations
You can see a set is calculated before the filters are applied. Putting a filter to context means it happens before the Set is computed.