Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rank value with duplicate category for each month

HI friends

How can I create a rank column with averaged value for each name with duplicate rows (because of date) like the example below

 

MonthCategoryValueRank column
JanA52
JanA72
FebA101
FebA151
JanB42
JanB82
FebB101
FebB121
  • Hi, Anonymous 

    Try calculated column as below:

    Rankx =
    VAR tab =
        SUMMARIZE (
            FILTER ( 'Table', 'Table'[Category] = EARLIER ( 'Table'[Category] ) ),
            'Table'[Month],
            'Table'[Category],
            'Table'[Average]
        )
    RETURN
        RANKX ( tab, 'Table'[Average],, DESC, DENSE )
    

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • Anonymous ,

    Avg = rankx(filter( allselected(Table[Category] , Table[Month] ), Table[Category] = max(Table[Category])), calculate(Avgerage(Table[Value])),,desc,dense)

    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you amitchandak for your reply but all returned only a value of 1

      • v-easonf-msft's avatar
        v-easonf-msft
        Icon for Community Support rankCommunity Support

        Hi, Anonymous 

        Try calculated column as below:

        Rankx =
        VAR tab =
            SUMMARIZE (
                FILTER ( 'Table', 'Table'[Category] = EARLIER ( 'Table'[Category] ) ),
                'Table'[Month],
                'Table'[Category],
                'Table'[Average]
            )
        RETURN
            RANKX ( tab, 'Table'[Average],, DESC, DENSE )
        

        Best Regards,
        Community Support Team _ Eason
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.