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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
malay1803
Frequent Visitor

How to get maximum salary, name of employee with maximum salary and department in power bi

Hey, I am new to power bi, and still learning. I want to know how to get maximum salary, name of employee with maximum salary and department in power bi? I want to show the data in tabular form.

1 ACCEPTED SOLUTION

Hi Have corrected the measure try this one:

MaxSalaryName =
CALCULATE (
    MAX ( 'Sheet5'[Name] ),
    FILTER (
        'Sheet5',
        'Sheet5'[Salary] = MAX ( 'Sheet5'[Salary] )
    )
) and 
max salary = MAX(Sheet5[Salary])
here is my output hope this should work
qqqqqwwwweeerrr_0-1713072609348.png

Regards

View solution in original post

8 REPLIES 8
SAMEERAHMAD
New Member

Hi, when I tried the same only for the name & max salary...it's getting me the max of name, means in sorted order ex name starting with Z***** against the salary

qqqqqwwwweeerrr
Super User
Super User

Hi @malay1803 

 

Based on input data here is my approach to finding max salary and name for a given department 

 

you need to create two measure:

1. max salary = MAX(Sheet4[Salary])

MaxSalaryName =
CALCULATE(
    MAX('Sheet4'[Name]),
    FILTER(
        'Sheet4',
        'Sheet4'[Salary] = [max salary]
    )
)
this is my output
qqqqqwwwweeerrr_0-1713023683190.png

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem

Regards

 

Hey, thanks for replying.
I tried this code, but the name which is being returned is the last name available for that dept.
So if the data goes like this:

NameDeptSalary
A13500
B14300
C12200
D21200
E23240
F36300
G32319
H31200


then the output should be 

NameDeptSalary
B14300
E23240
F36300


But using the measure/query provided by you. It is returning

NameDeptSalary
C14300
E23240
H38200

Hi Have corrected the measure try this one:

MaxSalaryName =
CALCULATE (
    MAX ( 'Sheet5'[Name] ),
    FILTER (
        'Sheet5',
        'Sheet5'[Salary] = MAX ( 'Sheet5'[Salary] )
    )
) and 
max salary = MAX(Sheet5[Salary])
here is my output hope this should work
qqqqqwwwweeerrr_0-1713072609348.png

Regards

Heyy, This WORKED! Thanks alot! Big Help!

PhilipTreacy
Super User
Super User

Hi @malay1803 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

Please supply some data and an example of the desired result.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hey Phil, Thanks for replying. As the data is quite huge, below is a dummy data.

NameDeptSalary
A13500
B12200
C14300
D21200
E23240
F36300
G32319
H38200


I want the below desired output.

NameDeptSalary
C14300
E23240
H38200

Hi,

These measures work

Max salary = MAX(Data[Salary])
Highest earner = CALCULATE(MAX(Data[Name]),FILTER(Data,Data[Salary]=[Max salary]))

Hope this helps.

Ashish_Mathur_0-1713051969569.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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