Forum Discussion
Help with TOP N Charts
- 4 years ago
Hi Anonymous ,
Suppose you have the following data.
Then for the category ranked 1 (FIN-Epro), use the [Sales] filter for the top 1 category to display the corresponding subcategories.
Then for the category ranked 2 (FIN-ENCORE), use the measure [Rank] filter for the top 1 category to display the corresponding subcategories.
Rank = VAR tab = SUMMARIZE ( ALLSELECTED ( 'Table' ), 'Table'[Categories], "s", SUM ( 'Table'[Sales] ) ) VAR RankCategory = COUNTROWS ( FILTER ( tab, [s] >= SUM ( 'Table'[Sales] ) ) ) RETURN IF ( RankCategory = 2, 1 )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , not very clear. see if this can help
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/