1 of 1 people found this helpful
Use an Index() Filter
So, you can use a parameter here if you want or hard-code to 5. I will demonstrate with a top n filter
Create a parameter [Top N Select]: As a range filter with the values set from 1-10
Next the filter [Top N]:
Index() < [Top N Select]+1
Place the [Top N] filter onto the filters and select 'True'
In my example, I have two charts, the left, does not filter but instead alters the colour according to the top n, this is to support the chart on the right, which does filter as requested, so you can see the filtering and compare back
This method assumes you are using a sorted set as shown in your screen-shot.
I have also included a method for an un-sorted set which can also apply to a set that is sorted differently; this uses a rank instead of an index, again, this is a table_calc:
Rank(Sum(Sales),'Desc') < [Top N Select]+1
These methods are also compatible with partitioning however, you do need to be mindful of the scope - ask if you need a hand with this.
Thank you for the solution,
It really helped me alot.