Forum Discussion

MV13's avatar
MV13
Frequent Visitor
8 years ago
Solved

RankX Measure ties affecting Pareto graph.

Hi All I am currently trying to build a Pareto graph that dynamically changes based on filter selections. I have created 3 measures to do this. The first measure Ranks the Data as Follows.  ...
  • MV13's avatar
    8 years ago

    Update: I have managed to solve the case of ties. To do this, I created a unique ID column in my data and then added the (Minimum of the ID)/Large Number to the rank calculation. So if two items are ranked 5 and one item had a Minimum ID of 2 and the second one had a Minimum of 4 I then took the ID and divided by 100 to get 0.02 and 0.04. So the ranks can be broken. The table below explains this:

     

    ValueRankMin of IDMin ID/100New ValueNew rank
    100130.03100.031
    12290.0912.092
    11350.0511.053
    10470.0710.075
    10480.0810.084
    7510.017.016

     

    So the New rank would then be:

    Rank = IF(HASONEVALUE('Table'[Group]),
        RANKX(ALLSELECTED('Table'[Group]),
        CALCULATE(SUM('Table'[Duration]), ALLSELECTED('DateTable'))+INT(CALCULATE(MIN('Table'[ID])))/100,,DESC))

     

    Hope this logic is clear for future queries.

     

    This solution was derived from a method shown on the site below:

    http://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures