Forum Discussion

itchyeyeballs's avatar
itchyeyeballs
Impactful Individual
10 years ago
Solved

rankx problem

Hi All,

 

I've got a problem with RankX that is proving difficult to resolve, would very much appreciate some assitance.

 

My rankX function looks like

RANKX(ALLSELECTED([Name]),[col3],[col1],DESC,Skip)

based on this data

 

for some reason the rank (col5) shown in the bold total row is 11 but it should show 10 as it does correctly in the data. the col 3 and col1 values are correct in the total so I can see why its adding 1 to the rank in the total. To add complexity this only happens for some of the total rows, most show correctly.

 

Am I missunderstanding how RankX works?

 

Any help appreciated

  • Hi,

     

    I solved the issue late last night, either its a bug in the Dax function or I'm missunderstanding how it works.

     

    To resolve I had to exclude the search value from the the underling list of values to be ranked against, it seems Dax was sometimes ranking an idenitcal value below itself hence adding 1 to the rank.

4 Replies

  • v-haibl-msft's avatar
    v-haibl-msft
    Microsoft Employee

    itchyeyeballs

     

    With part of data you provided, I could not correctly identify the problem. You can take a look at the last part of this blog. It explains how rankx works when we specific the third value argument.

    If possible, you can post more data here to help address the problem.

     

    Best Regards,

    Herbert

    • itchyeyeballs's avatar
      itchyeyeballs
      Impactful Individual

      Hi,

       

      I solved the issue late last night, either its a bug in the Dax function or I'm missunderstanding how it works.

       

      To resolve I had to exclude the search value from the the underling list of values to be ranked against, it seems Dax was sometimes ranking an idenitcal value below itself hence adding 1 to the rank.

      • cedric_267's avatar
        cedric_267
        Frequent Visitor

        It's a little bit late, but can you share the solution / your new fonction ?