Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Select a value of text column having maximum salary

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.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

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:

vyalanwumsft_0-1665456179191.png


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.

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

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:

vyalanwumsft_0-1665456179191.png


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.

v-yalanwu-msft
Community Support
Community Support

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:

vyalanwumsft_0-1664960422982.png


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.

Anonymous
Not applicable

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:

NameID
Pranav1
Sukhman2
Aidan3


Table2:

IDSalary
115000
225000
390000
amitchandak
Super User
Super User

@Anonymous , Use TOPN

 

TOP1 Name= CALCULATE([Net], TOPN(2,ALLSELECTED('Item'[Name]), calculate(Sum(Table[Salary])) ,DESC), values('Item'[Name]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors