Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
adelmonte
Resolver I
Resolver I

rankx multiple columns allselected

Hi all,

Can someone please give me a tip how to rank correctly my table.

 

M_TotalScore = SUM('ranking'[TOTAL SCORE])
M_Rank = RANKX(ALLSELECTED('ranking'), [M_TotalScore],,DESC,Dense)

 

adelmonte_0-1661982626124.png

Thanks,

Alex

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @adelmonte ,

According to your description, if you want to use RANKX function in a measure, add a CALCULATE function before it, modify the formula to:

Rank =
RANKX (
    ALLSELECTED ( 'ranking' ),
    CALCULATE ( SUM ( 'ranking'[TOTAL SCORE] ) ),
    ,
    DESC,
    DENSE
)

In my sample get the correct result.

vkalyjmsft_0-1662535612414.png

vkalyjmsft_1-1662535626952.png

vkalyjmsft_3-1662535697382.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @adelmonte ,

According to your description, if you want to use RANKX function in a measure, add a CALCULATE function before it, modify the formula to:

Rank =
RANKX (
    ALLSELECTED ( 'ranking' ),
    CALCULATE ( SUM ( 'ranking'[TOTAL SCORE] ) ),
    ,
    DESC,
    DENSE
)

In my sample get the correct result.

vkalyjmsft_0-1662535612414.png

vkalyjmsft_1-1662535626952.png

vkalyjmsft_3-1662535697382.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

parry2k
Super User
Super User

@adelmonte on what column do you want to RANK?

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k , on column TOTAL SCORE

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.