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 team
I want to add a dynamic measure in which I want to show the value having maximum salary.
Table
---------------------------------------
Name Salary
Aidan 25000
Sukhman 90000
Pranav 15000
So my measure should return only single value which is Pranav here.
Please help me to write this dax measure.
Solved! Go to Solution.
Hi, @Anonymous ;
Try it
Measure =
var _max=CALCULATE(MAX('Table2'[Salary]),ALL(Table2))
return CALCULATE(MAX('Table1'[Name]),FILTER('Table2',[Salary]=_max))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
Try it
Measure =
var _max=CALCULATE(MAX('Table2'[Salary]),ALL(Table2))
return CALCULATE(MAX('Table1'[Name]),FILTER('Table2',[Salary]=_max))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
Try this measure.
Measure =
var _max=CALCULATE(MAX('Table'[Salary]),ALL('Table'))
return CALCULATE(MAX('Table'[Name ]),FILTER(ALL('Table'),[Salary]=_max))
Since 90,000 > 25,000 > 15,000, shouldn't the biggest be Sukhman? so the final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-yalanwu-msft
It works fine with one table.
Lets say we have table table1 having Name table1[Name] and second one table2[Salary].
Table1:
Name | ID |
Pranav | 1 |
Sukhman | 2 |
Aidan | 3 |
Table2:
ID | Salary |
1 | 15000 |
2 | 25000 |
3 | 90000 |
@Anonymous , Use TOPN
TOP1 Name= CALCULATE([Net], TOPN(2,ALLSELECTED('Item'[Name]), calculate(Sum(Table[Salary])) ,DESC), values('Item'[Name]))
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 |
---|---|
97 | |
97 | |
82 | |
75 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |