March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
Solved! Go to Solution.
Hi Have corrected the measure try this one:
Regards
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
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])
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:
Name | Dept | Salary |
A | 1 | 3500 |
B | 1 | 4300 |
C | 1 | 2200 |
D | 2 | 1200 |
E | 2 | 3240 |
F | 3 | 6300 |
G | 3 | 2319 |
H | 3 | 1200 |
then the output should be
Name | Dept | Salary |
B | 1 | 4300 |
E | 2 | 3240 |
F | 3 | 6300 |
But using the measure/query provided by you. It is returning
Name | Dept | Salary |
C | 1 | 4300 |
E | 2 | 3240 |
H | 3 | 8200 |
Hi Have corrected the measure try this one:
Regards
Heyy, This WORKED! Thanks alot! Big Help!
Hi @malay1803
How to Get Your Question Answered Quickly - Microsoft Fabric Community
Please supply some data and an example of the desired result.
Phil
Proud to be a Super User!
Hey Phil, Thanks for replying. As the data is quite huge, below is a dummy data.
Name | Dept | Salary |
A | 1 | 3500 |
B | 1 | 2200 |
C | 1 | 4300 |
D | 2 | 1200 |
E | 2 | 3240 |
F | 3 | 6300 |
G | 3 | 2319 |
H | 3 | 8200 |
I want the below desired output.
Name | Dept | Salary |
C | 1 | 4300 |
E | 2 | 3240 |
H | 3 | 8200 |
Hi,
These measures work
Max salary = MAX(Data[Salary])
Highest earner = CALCULATE(MAX(Data[Name]),FILTER(Data,Data[Salary]=[Max salary]))
Hope this helps.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
94 | |
86 | |
82 | |
76 | |
49 |
User | Count |
---|---|
160 | |
144 | |
103 | |
74 | |
57 |