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 Rank with Grouping

I used the following measure to Rank items within their respective Product Families:

 

Product Family Rank - POS Sales = RANKX(ALLEXCEPT(Material,Material[Prod Hier: Product Family]),'POS Sales'[POS Sales])

 

It seemed to be working but there are a few instances where it is wrong. See below. The highlighted item should be listed as 1 because its the top item by POS Sales in the Soft Coolers Product Family, yet its showing 2.

marksaba_0-1699907627671.png

 

Any ideas how to resovle?

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try measures like

 


Create a measure assuming [POS Sales] is a measure

M1= calculate([POS Sales], filter(allselected(Material), Material[Prod Hier: Product Family] = max(Material[Prod Hier: Product Family])))


Product Family Rank - POS Sales = RANKX(allselected(Material[Prod Hier: Product Family]),[M1])

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

No matter how much I filter down, I am still seeing "this visual has exceeded the available resources" when I input this formula in. Do you have an alternative?

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.