Forum Discussion
Nas
5 years agoNew Member
Filter by Field
Hi, May I please ask if its possible to filter Top 5 by field. The field contains Dom Air, Reg Air , Int Air. I would like to filter top 5 routes by Trns used by Dom Air, Reg Air, Int Air in one visu...
amitchandak
5 years agoSuper User
Nas ,
In the visual level filter, you can use TOP N on the group by and Measure
You can create a Top N measure and that will filter if there is no other measure or use this a filter
example
Top 5 City Rank = CALCULATE([Sales],TOPN(5,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))
You can create rank and filter
City Rank = RANKX(all(Geography[City]),[Sales])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415