Forum Discussion
GroupBy function
- 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.
Hi v-jingzhang,
Many thanks for helping with the query. The Average for the group worked fine. However the problem is with the ranking function. I have added few more data lines to the existing table for your refernce.
Looking forward for your assistance in resloving this.
Year Country Item Category Amount
2021 USA Iron C1 0
2021 USA Iron C2 0
2021 USA Iron C3 0
2021 USA Iron C4 0
2021 USA Iron C5 0
2021 USA Iron C6 0
2021 USA Iron C7 0
2021 USA Iron C8 1
2021 USA Iron C9 0
2021 USA Iron C10 0
2021 USA Iron C11 0
2021 USA Iron C12 0
2021 UK Iron C1 1
2021 UK Iron C2 1
2021 UK Iron C3 0
2021 UK Iron C4 0
2021 UK Iron C5 0
2021 UK Iron C6 0
2021 UK Iron C7 0
2021 UK Iron C8 1
2021 UK Iron C9 0
2021 UK Iron C10 0
2021 UK Iron C11 0
2021 UK Iron C12 0
2021 UK Aluminium C1 0
2021 UK Aluminium C2 0
2021 UK Aluminium C3 0
2021 UK Aluminium C4 0
2021 UK Aluminium C5 0
2021 UK Aluminium C6 0
2021 UK Aluminium C7 0
2021 UK Aluminium C8 0
2021 UK Aluminium C9 0
2021 UK Aluminium C10 0
2021 UK Aluminium C11 0
2021 UK Aluminium C12 0
2021 USA Bronze C1 1
2021 USA Bronze C2 0
2021 USA Bronze C3 1
2021 USA Bronze C4 0
2021 USA Bronze C5 0
2021 USA Bronze C6 0
2021 USA Bronze C7 0
2021 USA Bronze C8 0
2021 USA Bronze C9 0
2021 USA Bronze C10 0
2021 USA Bronze C11 0
2021 USA Bronze C12 0
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.
- Diptarup5 years ago
Helper II
Many thanks. Really Appreciate your help.