Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

RANKX tie break

Hi,

 

trying to get 10 Most/least booked spaces, from a building desk booking table. I tried to do ranking and select top/bottom 10 from the list, but the ranking logic does not work properly, when it has the same duration total (when it's a tie). 

 

 

For Top10, expecting it to return only the top 5 results (the ranking should be sequential and unique).

 

measures,

TableTopRank = RANKX (ALL(BookingAppointments),[TableTotalDuration],,DESC,Dense)
TableTotalDuration = SUM(BookingAppointments[Duration Minutes])
 

Any help or suggestions please?

 

  • Hi Anonymous ,

     

    1, First, add a grouping and sum column in Power Query (Equivalent to the measure [TableTotalDuration].)

    2, Sort the column created in the first step.

    3, Add an Index column.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

1 Reply

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    1, First, add a grouping and sum column in Power Query (Equivalent to the measure [TableTotalDuration].)

    2, Sort the column created in the first step.

    3, Add an Index column.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.