cancel
Showing results for 
Search instead for 
Did you mean: 
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 IV
Super User IV

@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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

This is the best i can do at the moment.

jspo_0-1623781525979.png

 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors