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

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

Reply
Anonymous
Not applicable

RANKX not working as expected

Hi All,

 

I have a simple query my RANKX is not working as expected can someone please explain me whats wrong? when i try to use ALL() function with only table name giving wrong result as below

My Measures

total sum = sum('FoodMart-Transaction-(1997-1998)'[quantity])
RANKX = Rankx(all('Calendar-Lookup'),[total sum])

husnabanu_0-1622175991513.png

 

however, when i try to give ALL() function with table[column name] its working fine how ?? shouldnt that yeild correct result irrespective of table name or column name??

RANKX = Rankx(all('Calendar-Lookup'[YEAR]),[total sum])

husnabanu_1-1622176096520.png

Regards,

Husna

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with your original data and relationship between tables.

 

https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/

 

 

Best Regards,
Stephen Tao

amitchandak
Super User
Super User

@Anonymous , rank is context-sensitive. In the first case, the rank would be calculated at the lowest level of the calendar each year.

 

Refer this to get how Rank works
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

 

 

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

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors