Forum Discussion

vilnyts's avatar
vilnyts
Frequent Visitor
4 years ago
Solved

Adding RAND() number to measure and RANKX() it

Hi, everyone. I have a problem when i am using RANKX() function. I have a one column table that contains redundant category names (AAA, BBB, CCC.....FFF) and have a measure that counts rows through...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below measures and the attached pbix file.

    I suggest writing an additional measure like below.

     

    Rankalphabet = 
    RANKX ( ALL ( 'Table'[Dim] ), CALCULATE ( MAX ( 'Table'[Dim] ) ),, ASC ) / 100
    

     

    Counts = 
    COUNT(
    'Table'[Dim]
    ) + [Rankalphabet]

     

    RankRows = 
    RANKX(ALL('Table'[Dim]),  [Counts],, DESC)