RANKX avoid duplicate

Hi all,

I’ve some issue with my RANKX, currently having same ranking. I’ve watched and tried this sample :
Developing Custom Tiebreakers in RANKX - DAX Tutorial - YouTube

However still it is showing same rank, even there is some skip rank. Strange is in the table it looks no duplicate, but the result is like I just said.

By looking at the image, column Turnover days tiebreaker actually already don;t have any duplication, but result is some duplicates and some skipped.

So here are the DAX:

  1. Ranking my value (Turnoverdays)

Rank product tiebreaker =
VAR tmp = [Turnover days]
VAR tmpRank = IF(
tmp <> 0,
RANKX(
FILTER(
ALL(‘Released products’[Product number]),
[Turnover days] <> 0),
[Turnover days] ,DESC,Dense
),
BLANK()
)

VAR RankScale = DIVIDE(tmpRank + RAND(),100)

RETURN IF(
tmp <> 0,
RankScale,
BLANK()
)

  1. Adding my value (Turnover days) into the result of point 1. And this already strange because it looks the add is wrong.

Turnover days tiebreaker = [Turnover days] + [Rank product tiebreaker]

  1. Ranking based on no 2. While no 2 result has no duplicate, I’ve created this :

Rankx Contest Final =
VAR temp = [Turnover days tiebreaker]
RETURN IF(
temp <> 0,
RANKX(
FILTER(
ALL(‘Released products’[Product number]),
[Turnover days tiebreaker] <> 0),
[Turnover days tiebreaker],
DESC,
Dense
),
BLANK()
)

On the list, we can see “Turnover days tiebreaker” already all unique, but result from point 3 (Rankx contest final) is still wrong.

Thanks,

@Toni
Can you please share your sample pbix file?
Also refer to the following guidelines that will help in answering to the questions effieciently.

https://forum.enterprisedna.co/t/asking-questions-on-the-enterprise-dna-support-forum/30/

Thanks.

Hi @Toni, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.

  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

    image

  • Use the proper category that best describes your topic

  • Provide as much context to a question as possible.

  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

@Toni Don’t use RAND for breaking ties. PERIOD.

Refer to this:

Ranking (Breaking Ties) for a Category based on a Measure with duplicate values for categories - DAX Calculations - Enterprise DNA Forum

and this by @BrianJ :

Developing Custom Tiebreakers in RANKX - DAX Tutorial - YouTube

2 Likes

Hi @Toni, we’ve noticed that no response has been received from you since the 8th of December. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

Hi @Toni, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Thanks!