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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.