Forum Discussion
ngocnguyen
3 years agoHelper IV
Top 2 category
Hi
I have the input table as below. Is there any way to have the top 2 table ?
Logic for Top 2 Table:. Finding the top 2 category by Amt , then showing up the detail of category by Route
Thanks
ngocnguyen I just called my source table Top 2 is all. See PBIX below sig.
7 Replies
- Greg_DecklerCommunity Champion
ngocnguyen Try:
Table 3 = VAR __Table = SUMMARIZE('Top2',[CAT],"__Amt",SUM('Top2'[Amt])) VAR __Table1 = ADDCOLUMNS(__Table,"__Rank",RANKX(__Table,[__Amt])) VAR __Categories = DISTINCT(SELECTCOLUMNS(FILTER(__Table1,[__Rank]<3),"__CAT",[CAT])) RETURN FILTER('Top2',[CAT] IN __Categories)- ngocnguyenHelper IV
Many thanks for your support.
However, Top 2 table is the Output, but in your Dax formular, you calling the Top 2 table?,
It 's a litte bit confusing. Could you please check again?
- Greg_DecklerCommunity Champion
- CNENFRNLCommunity Champion
- ngocnguyenHelper IV
Hi CNENFRNL
Highly appreciate your support.
is there any way to get the Output as below?
Logic: get top 2 Amt by both CAT & Route