Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.