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.
Hi,
What I'm trying to do seems easy, but I can't find a way to get it working.
I have a table with multiple categories, where a category could exist multiple times, and the amount:
Category | Amount |
a | 5 |
b | 10 |
c | 2 |
a | 3 |
b | 20 |
c | 9 |
I would like to create a DAX measure that shows me the category name of the category with the highest SUM of the values for that category. In this case the measure should just display: "b"
* (10+20) is the higest sum *
** As a reference:
When I create a table with the summarized value. I would like the top 1 category name in a Card visual, here value "b".
Thanks in advance.
Jef
Solved! Go to Solution.
Hi @Anonymous
You can use an expression like below in your card visual.
rankCategory =
CONCATENATEX(
TOPN( 1, ALL( 'Table'[Category] ), CALCULATE( SUM( 'Table'[Amount] ), ALL( 'Table'[Amount] ) ) ),
'Table'[Category],
"; "
)
Please see the attached file for the ref
Hi @Anonymous
You can use an expression like below in your card visual.
rankCategory =
CONCATENATEX(
TOPN( 1, ALL( 'Table'[Category] ), CALCULATE( SUM( 'Table'[Amount] ), ALL( 'Table'[Amount] ) ) ),
'Table'[Category],
"; "
)
Please see the attached file for the ref
Thanks. It is working perfect.
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |