Forum Discussion

Diptarup's avatar
Diptarup
Icon for Helper II rankHelper II
5 years ago
Solved

GroupBy function

I am trying to use GroupBy function along with SumX and AverageX to get to particular result.   Let me explain it using a table   Year    Country  Item     Category     Amount 2021     USA      ...
  • v-jingzhang's avatar
    v-jingzhang
    5 years ago

    Hi Diptarup 

     

    Sorry I don't know how to modify the Rank measure...😅 But I found a workaround to get the same result. I summarize data into a new table with DAX, then add a rank column to this table. Just like below.

    Create a new table:

    RankTable = ADDCOLUMNS(SUMMARIZE('Table','Table'[Year],'Table'[Country],'Table'[Item]),"Average_of_Group",[Average of Group])

    Create a new column:

    Index = RANKX('RankTable',[Average_of_Group],,DESC,Dense)

    At last, use columns from this RankTable to create a table visual.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.