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
Marcus_swe
Frequent Visitor

RANKX - inconsistent ranking

Hi, I am new to the PowerBi world, mostly fun but i have been stuck on this issue for some time now.

I can't figure out why i can't get the RANKX function to work.

I want to summarize all the sales done by Sales Person ID and then rank the top 15 salespersons. 

When i try to rank the Sales ID by the total amount of sales i get an inconsistent ranking. 

 

  • Why do i get this inconsistent ranking and how can i fix it?

Tried different YouTube-guides but can figure out what the issue is. 

 

I have a huge Excel-file containing loads of data. But for what i want to achieve i only need two columns (I think) from the excel file. I have created an example from fake data down below. 

Note that the sales data excel file is roughly 2500 rows. 

 

Powerbi_RankingData.png

 

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Marcus_swe 

You may use below measure:

Ranking by sales =
RANKX (
    ALL ( Table1[Sales Person ID] ),
    CALCULATE ( SUM ( Table1[Sales] ) ),
    ,
    DESC,
    DENSE
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Marcus_swe
Frequent Visitor

@Anonymous Thank you for the links, they gave me alot better understanding! 

 

@v-cherch-msft Worked like a charm, together with the other information i have recoved i should be able to sort things out now! 

 

@mussaenda Cant understand why i didnt find that youtube clip by my selfe, it was more or less exactly what i was looking for! 

 

I am verry greatful for your help!!

 

BR Marcus

mussaenda
Super User
Super User

You may want to watch this tutorial re rankx

v-cherch-msft
Employee
Employee

Hi @Marcus_swe 

You may use below measure:

Ranking by sales =
RANKX (
    ALL ( Table1[Sales Person ID] ),
    CALCULATE ( SUM ( Table1[Sales] ) ),
    ,
    DESC,
    DENSE
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

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.