Reputation: 489
I'm looking for good solution to be able to present on a table visual in Power BI TOP 5 highest values out of column X in table, grouped by User name in column Y of the same table.
So for each distinct user in column Y I need to show top 5 values in column X in descending order.
Upvotes: 0
Views: 1196
Reputation: 2584
You can get the Top 5 details by using the RANKX
function:
Rank = RANKX(CALCULATETABLE(Table,ALLEXCEPT(Table,Table[Column Y])),Table[Column X],,DESC,DENSE)
The above calculation will give you the dense rank. If you want the normal ranking use "skip" instead of "dense". Once the rank is calculated, you can filter the rank value for <=5 and you should be able to get the desired output.
Upvotes: 1