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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.