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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Raado12
Regular Visitor

RANKX measure skips in hierarchy - using measure

Hello,

I have a problem with RANKX function. Now I have a formula:

RANKX(ALL(clinics[region]),[%To Goal],,,Dense)
 
I have already tried combination with function IF which include function ISFILTERED on a column region of table clinics.
 
Matrix has two rows, one (upper) is region and one (lower) level is office. I want to calculate rank of region (the upper rows in hierarchy) based on the values in column %Goal. The results are a bit weird, the ranks are skipped and I get rank of 1 and 4, but I have only two regions. Can someone help me?
region.JPG

 

2 REPLIES 2
wdx223_Daniel
Super User
Super User

RANKX(ALL(clinics[region]),calculate([%To Goal],all(office)),,,Dense)

CNENFRNL
Community Champion
Community Champion

Hi, @Raado12 , as to your measure

RANKX(ALL(clinics[region]),[%To Goal],,,Dense)

the rank evaluates among all items in clinics[region] column, which results in the seemingly weird result.

 

Generally speaking, hierarchical rank requires ISINSCOPE() to distinguish level it resides in. You may want to refer to this article for more details.

 

Should you have further questions or some other issues, it's better to attach a dummy file with mockup data for futher disscusion.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.