Forum Discussion
Anonymous
4 years agoNot applicable
Top N value based on category
Hello I need help to have filter for top N for column "Values" for each category. if I can have button for top 2 values and once I select a slicer filter for category = New, it show me all the col...
- 4 years ago
Hi, Anonymous ;
You could create a flag measure.
Flag = IF( RANKX(FILTER(ALLSELECTED('Table'),[Category]=MAX('Table'[Category])),CALCULATE(SUM('Table'[Value])),,DESC)<=2,1)Then apply it into filter.
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
viviank
4 years agoResolver I
I always have to watch a video or google to remind myself how to do this.
I know you want to use RANKX to get the Top X (in this case the Top 2).
Try watching this: https://www.youtube.com/watch?v=TSOL213OqwY