Forum Discussion

BUserTG's avatar
BUserTG
Frequent Visitor
5 years ago

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

  • 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.