The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi There,
I want dax measure to return the names of the country which have the highest value. The value here is a measure itself.
I have used here a trick of using a line chart and filtering on top n as 1, but this give only 1 country as max, if i have more than 1 countries- how can i get that?
Thanks!
Solved! Go to Solution.
Hi @Anonymous
You can try
Max Country =
VAR T1 =
ADDCOLUMNS ( VALUES ( TableName[Country] ), "@Value", [Measure] )
VAR MaxValue =
MAXX ( T1, [@Value] )
VAR MaxRecord =
FILTER ( T1, [@value] = MaxValue )
RETURN
MAXX ( T1, [Country] )
Hi @Anonymous
You can try
Max Country =
VAR T1 =
ADDCOLUMNS ( VALUES ( TableName[Country] ), "@Value", [Measure] )
VAR MaxValue =
MAXX ( T1, [@Value] )
VAR MaxRecord =
FILTER ( T1, [@value] = MaxValue )
RETURN
MAXX ( T1, [Country] )
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
14 | |
14 | |
9 | |
7 |