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
ibuhary
Helper I
Helper 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.

1 ACCEPTED SOLUTION
sokg
Solution Supplier
Solution Supplier

Not in my test data. See pic below

 

Capture.JPG

View solution in original post

10 REPLIES 10
sokg
Solution Supplier
Solution 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 )

In that case the ranks returned are all 1 for all the stores

sokg
Solution Supplier
Solution Supplier

Not in my test data. See pic below

 

Capture.JPG

Actually I have a larger database, but I cut it short to ask the question.

 

Is it possible to send it to you to check what I am doing wrong ?

sokg
Solution Supplier
Solution Supplier

Yes, my email is sokg@yahoo.com. You can send me your .pbix file.

Please check your privacy of your data. I assume you are allowed to do that.

 

 

I have sent you the file in your email

Hi, Have you been able to check my file.

sokg
Solution Supplier
Solution Supplier

I have not receive it.

Please send it again

 

sokg@yahoo.com

Please check, I sent again now.

Anonymous
Not applicable

Did you ever get a response? I have the same issue.

 

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.