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
Anonymous
Not applicable

classic RANKx issue

I am using AdventureWorks DB and I want to rank the resellers by their total sale amount. So basically the table looks like this:

rKs9E.png

 

I used the following measure to rank it:

Rank Reseller = RANKX(ALL(ResellerSales), MAX(ResellerSales[SalesAmount]),,1)

But it returns only 1 as the rank.

 

Q8.png

 

followed these two videos:

https://www.youtube.com/watch?v=z2qzJVeYhTY

and

https://www.youtube.com/watch?v=SsZseKOgrWQ&t=603s

 

but I can't understand what is wrong. 

 

Can anyone explain, please 😞

 

2 ACCEPTED SOLUTIONS
Sean
Community Champion
Community Champion

@Anonymous

The Measure I posted above works in the file you shared! Smiley Happy

In the File you uploaded you had the Reseller Key from the Reseller Sales table and that's why it works,

In the picture you posted above it did not work because you had the Reseller Key from the Reseller Table.

In that case you need to adjust the Measure to reference that table.

Rank Reseller 2 = RANKX ( ALLSELECTED ( Reseller[ResellerKey] ), CALCULATE ( SUM ( ResellerSales[SalesAmount] ) ), ,)

 

RANKX Works.png

View solution in original post

@Anonymous

 

 @Sean MEASURE works well in the file

 

But in the screen shot, i noticed that you are also including Reseller Name from another Table "Reseller"

 

If you include that other column, this MEASURE would work

 

 

Rank Reseller =
RANKX (
    SUMMARIZE (
        ALLSELECTED ( ResellerSales ),
        ResellerSales[ResellerKey],
        Reseller[ResellerName]
    ),
    CALCULATE ( SUM ( ResellerSales[SalesAmount] ) ),
    ,
)

advenrue.png


Regards
Zubair

Please try my custom visuals

View solution in original post

11 REPLIES 11

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.

Top Solution Authors