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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
wenchi
Helper I
Helper I

Rankx return incorrect value randomly

Hi,

We have a PBI report using SSAS live connection to Azure AS model. I am using the rankx function to rank product brand by current year vol. It's not showing the correct rank number all the time. (see picture below) There are few rows with different vol but rank the same. Sometimes it seems worinking just fine, but not all the time and I can figure it out.

 

Here is the measure,  

brand_rank = if(ISINSCOPE(Dim_Custom_BrandGroup[brand_family_des]),
CALCULATE(RANKX(ALL(Dim_Custom_BrandGroup[brand_family_des]),[Chain CURR Pd Vol],,DESC,Skip),Dim_Custom_BrandGroup[group_type]="brand family"),BLANK())
 
Rank.png 

Really appreciated for all helps.
 
Wenchi
4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@wenchi Those are indications of ties. Would need to know what [Chain CURR Pd Vol] is.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

The [Chain CURR Pd Vol] is the last column shown in the picture. it definitely shows different volume with the same rank, which is incorrect. I've validate the data against our database and it shows correct volume.

When you calculate the rank, you are CHANGING THE CONTEXT of the calculation: Dim_Custom_BrandGroup[group_type]="brand family". This is why your rank does not tally with what you see in the matrix. In the matrix you don't change the context.

i have the same filter applied to the table visual.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.