Forum Discussion
ibuhary
7 years agoHelper I
RANKX
Hello there,
I have a table with Store ID, Store Name and Sales.
I have created a measure to Rank the Store Names based on highest sales.
StoreRank = RANKX(ALLSELECTED(
'Table'[Store Name]),
CALCULATE(SUM('Table'[Sales])),,DESC)
When I use the Rank alone with Store Name it works, but the moment I add store ID in the table it returns all ranks to - 1
Can anyone help me solve this issue, please.
Not in my test data. See pic below
10 Replies
- sokgSolution Supplier
Why do you use ALLSELECTED instead of ALL???
Why do you use 'Table'[Store Name] instead of just 'Table'???
so try this
StoreRank = RANKX ( ALL ( Table ), CALCULATE ( SUM ( 'Table'[Sales] ) ),, DESC )