Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello!
I need a DAX consult to select a Gender with the max Amount from my table filtered by a Category.
With SQL ir should be: SELECT TOP 1 Gender FROM TableName WHERE Category = "A" ORDER BY Amount.
My Table is:
Gender | Amount | Category | Cases |
Male | 6768768 | A | 6 |
Male | 344 | B | 8 |
Male | 44442 | C | 6 |
Male | 3344 | D | 5 |
Female | 7656 | A | 4 |
Female | 44577 | B | 3 |
Female | 334442 | C | 6 |
Female | 455 | D | 5 |
Thanks!!!!
Solved! Go to Solution.
Or you can hardcode it for Category A as follows
Measure 2 = TOPN ( 1, VALUES ( TableName[Gender] ), CALCULATE ( SUM ( TableName[Amount] ), TableName[Category] = "A" ), DESC )
Hi @rauldip22
Try this MEASURE...It will give you the Gender with Highest Amount according to category or cases that you select
Measure = TOPN ( 1, VALUES ( TableName[Gender] ), CALCULATE ( SUM ( TableName[Amount] ) ), DESC )
Or you can hardcode it for Category A as follows
Measure 2 = TOPN ( 1, VALUES ( TableName[Gender] ), CALCULATE ( SUM ( TableName[Amount] ), TableName[Category] = "A" ), DESC )
Thanks!!! It Works!
User | Count |
---|---|
93 | |
88 | |
68 | |
62 | |
58 |
User | Count |
---|---|
149 | |
113 | |
95 | |
80 | |
72 |