Forum Discussion
johnmelbourne
7 years agoHelper V
Simple TOPN
Confused. Here is my simple as data set. Table name = complaints Columns: Tier2, Cases I just want to be able to filter the table by top5 cases by Tier2 category. Any solutions? ...
- 7 years ago
FilteredTable = TOPN( 5, complaints, complaints[cases], DESC )
- 7 years ago
Hi johnmelbourne
You can use Rank as a measure like below.Rank Cases by Tier2= RANKX( CALCULATETABLE( VALUES( complaints[Tier2] ), ALLSELECTED() ), CALCULATE( SUM( complaints[Cases] ) ),, DESC )Or Column
Rank Cases by Tier2 = RANKX( VALUES( complaints[Tier2] ), CALCULATE( SUM( complaints[Cases] ) ),,, Dense )Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HotChilli
7 years agoCommunity Champion
FilteredTable = TOPN( 5, complaints, complaints[cases], DESC )
- johnmelbourne7 years agoHelper VThank you HotChilli.
- johnmelbourne7 years agoHelper V
This article helped, in that TOPN is useless by itself.
https://www.dutchdatadude.com/power-bi-pro-tip-confusion-about-topn-versus-rankx/