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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.