Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear friends,
I want to rank descending some data, then i can flag the category by get the top 2 biggest sub category.
i attach my PBIX here : https://1drv.ms/u/s!AhkGQiSs1aWEo3TBgvcNe_DiqS9r?e=pHEN9w
thanks for help
Solved! Go to Solution.
TOP 2 =
CONCATENATEX(
TOPN( 2, Sheet1, CALCULATE( SUM( Sheet1[value] ) ) ),
Sheet1[category],
", "
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
TOP 2 =
CONCATENATEX(
TOPN( 2, Sheet1, CALCULATE( SUM( Sheet1[value] ) ) ),
Sheet1[category],
", "
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Sir, would you like to send me pbix file please ? thanks
Pls refert to the attached pbix file below.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@ade_kurniawan , Create Rank in one of the manner and use visual level filter to filter Rank<=2
Cat Rank = Rankx(allselected(Table[Category]), calculate(sum(Table[Value])),,desc)
You can also refer this
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
Cat Rank = Rankx(filter(allselected(Table[City],Table[Category]) [City] = Max([City])) , calculate(sum(Table[Value])),,desc)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |