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.
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!
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 |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |