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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BUserTG
Frequent Visitor

RANKX returning multiple of the same value

I'm trying to perform a very simple RANK calculation of Stores but the result is returning the same ranking for multiple stores. I have a simple fact table with multiple transactions per store and then a DimStore table. When I look at a table ranking the stores, there are multiple 1s, 2s, 3s in the ranking.

 

The measure is: RANKX(ALL(DimStore), Fact[Sales], ,DESC, Dense)

 

Fact[Sales] is a SUM measure and I need the ranking to be dynamic based on filter context that could be passed. Any ideas why this would be happening? I've tried ALLSELECTED.

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Your measure should be something like this

 =RANKX(ALL(DimStore[Store Name]),[Sales], ,DESC, Dense)

To your visual, drag Store Name from the DimStore Table.  Sales being a measure should never be precedeed with the Table name.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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