Forum Discussion

Marcus_swe's avatar
Marcus_swe
Frequent Visitor
7 years ago
Solved

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. 

 

 

  • Hi Marcus_swe 

    You may use below measure:

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

    Regards,

4 Replies