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
jspo
New Member

rankX Ties Returns Higher Value

I have a rank measure defined as 

m_Dealer Rank DESC =
RANKX(ALL('Register'[Name]),[m_GM %],,DESC)
 
This appears to work as intended except when we have ties.  Say we have a tie in the 4th positions the above returns 5s
1
2
3
5
5
6
8
8
9
10
 
In the above example is want to see 4s and 7s (skip  5 and 8 )
 
Thanks in advance.
Jeff
6 REPLIES 6
v-yangliu-msft
Community Support
Community Support

Hi  @jspo ,

I created some data:

vyangliumsft_0-1623916704746.png

Here are the steps you can follow:

1. Enter power query through transform data and select add column --- index column --- from 1 to generate the index

vyangliumsft_1-1623916704752.png

2. Create measure.

amount_measure = MAX('Table'[amount])
Rank = RANKX(ALLSELECTED('Table'),CALCULATE([amount_measure]+MAX([Index])*0.001),,ASC,Dense)

3. Result:

vyangliumsft_2-1623916704754.png

 

 

Best Regards,

Liu Yang

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

This did not solve our issue.  This is basically a 2 tier ordering.  really we need to fix the numbering to be correct so we can retain confidence in our dashboard.

 

Jspo

amitchandak
Super User
Super User

@jspo , Try with dense

 

m_Dealer Rank DESC =
RANKX(ALL('Register'[Name]),[m_Gross Margin %],,DESC,dense )

 

Refer to break ties
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

thanks @amitchandak but neither Dense or Skip changed the numbering sequence.

@jspo ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

This is the best i can do at the moment.

jspo_0-1623781525979.png

 

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.