Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Issue with Rankx Feature

I m using Rankx feature for getting to display top N Products for multiple selections across platforms. The function works fine for single selectionn but return multiple products from each category if choosen. How do I put it to select the Top  N from multiple Categories as well. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

You can write a measure with a variable to summary table records and add a custom field for the ranking, then you can extract the rank number from the slicer to filter on the variable table and get the matched record id list. Then you can use this to compare with the current row context id to return the tag.

How to Summarize and Rank the Data based on Count in Power BI | Power BI Kingdom | Blog (excelkingdom.blogspot.com)
After these steps, you can use this measure on your visual level filter to enable filter effects.
Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

You can write a measure with a variable to summary table records and add a custom field for the ranking, then you can extract the rank number from the slicer to filter on the variable table and get the matched record id list. Then you can use this to compare with the current row context id to return the tag.

How to Summarize and Rank the Data based on Count in Power BI | Power BI Kingdom | Blog (excelkingdom.blogspot.com)
After these steps, you can use this measure on your visual level filter to enable filter effects.
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.