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

DAX RANKX Dynamic Top N by Multiple / Two Columns

Hi Rank Fans!

 

I know there have been similar questions posted, and I review those but still cannot solve for this issue.

 

I want to filter for Top 3 by two columns.  In theis example, I want to return the Top 3 by Revenue per Property and Vendor.  I want only the green values returned.   I have tried multiple times using RankX, AllSelected and Calculate.  The measure needs to be dynamic and reflect the Top 3 per Property and Vendor for the slicers slected by the user.

 

pbi.png

 

Thank you!

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a rank measure like and filter that for 3 in visual lebel filter

 

Rankx(filter(allselected(Table[Prop], Table[Vador]), [Prop] = max([Prop])),[Revenue])

 

Assuming revenue is measure

 

refer

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can create a rank measure like and filter that for 3 in visual lebel filter

 

Rankx(filter(allselected(Table[Prop], Table[Vador]), [Prop] = max([Prop])),[Revenue])

 

Assuming revenue is measure

 

refer

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

That worked! Thank you so much!

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.