Skip to main content

Power BI

New

RANKX new tie-breaking argument (SKIP, DENSE exist now...) RANDBREAK

Vote (14) Share
Matt H's profile image

Matt H on 19 Sep 2019 08:58:49

I'd like a way for RANKX to arbitrarily/randomly break runs of tied data. An example set of 5 categories could see a ranking such as the following Blue - 1, Yellow - 2, Red - 3, Green - 3, Pink - 5 using the SKIP argument. I'd like, in this example, for either Red or Green to see a 4 as its rank. I don't care how it happens, just need it to be a series of rank values in certain use-cases, rather than grouping the ties.

Comments (3)
Matt H's profile image Profile Picture

46a87bbb ac27-4e03-a801-c816f41fe7df on 16 Aug 2020 04:17:25

RE: RANKX new tie-breaking argument (SKIP, DENSE exist now...) RANDBREAK

I've needed to break ties previously in a non-random way, and did it by having a CustomerID table with a numerical index that I then divided by a very large number, which leaves a very small number for each CustomerID. I then added that in my measure to whatever else I was measuring, which got rid of the tie breaks.

Matt H's profile image Profile Picture

7c69182e 0f77-4b2a-9418-a3457d197181 on 16 Aug 2020 04:16:03

RE: RANKX new tie-breaking argument (SKIP, DENSE exist now...) RANDBREAK

This is particularly difficult to replicate in DAX currently, and would be a very useful (though admittedly potentially dangerous) third option. I like the name "Randbreak" too (better than "Unique" , "Tiebreak", etc)

Matt H's profile image Profile Picture

e44a77bc 195b-4994-8100-e9f15aa1fdb2 on 16 Aug 2020 04:16:03

RE: RANKX new tie-breaking argument (SKIP, DENSE exist now...) RANDBREAK

Thanks Steve! I agree, to achieve desired results your data needs either a unique ID field or a date field which you know will be unique in any filter context.

Hope they can add it!