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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
edwardburton
Regular Visitor

RANKX ignoring Order and Ties

Hello

 

I've used this piece of code from the answer linked almost exactly.

 

SumPointsRank = 
Var summry=SUMMARIZE(ALLSELECTED(Results),[Player],"Sum",SUM(Results[Points]))
var tmp=ADDCOLUMNS(summry,"RNK",RANKX(summry,[Sum],,DESC,Dense))
return
MAXX(FILTER(tmp,[Player]=SELECTEDVALUE(Results[Player])),[RNK])

Solved: Ranking a measure - Microsoft Power BI Community

The problem I'm having is that it appears to be stuck at ASC and Dense no matter what I enter there. I'd like it to be DESC and Skip, but it just ignores those commands and uses ASC and Dense almost as a default.

 

Is this a problem anyone else has seen and knows how to fix?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@edwardburton , what is the expected output

 

Try like

RANKX(allselected(Results[Player]),calculate(SUM(Results[Points])),,DESC,skip)

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @edwardburton 

Try the second measure

Measure2=
RANKX(ALLSELECTED(Results),CALCULATE(SUM(Results[Points]),ALLEXCEPT(Results,Results[Player])),,DESC,Dense)

 

If this doesn't work, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

amitchandak
Super User
Super User

@edwardburton , what is the expected output

 

Try like

RANKX(allselected(Results[Player]),calculate(SUM(Results[Points])),,DESC,skip)

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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