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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sivarajan21
Helper V
Helper V

How to create dax to find max salary in same column

Hi,

 

I have these below two sample datasets:

PFA sample file in below link:

To find max salary.pbix

 

Worker table:

worker_idfirst_namelast_namesalaryjoining_datedepartment
1MonikaArora10000020/02/2014 00:00HR
2NiharikaVerma8000011/06/2014 00:00Admin
3VishalSinghal30000020/02/2014 00:00HR
4AmitahSingh50000020/02/2014 00:00Admin
5VivekBhati50000011/06/2014 00:00Admin
6VipulDiwan20000011/06/2014 00:00Account
7SatishKumar7500020/01/2014 00:00Account
8GeetikaChauhan9000011/04/2014 00:00Admin
9AgepiArgon9000010/04/2015 00:00Admin
10MoeAcharya6500011/04/2015 00:00HR
11NayahLaghari7500020/03/2014 00:00Account
12JaiPatel8500021/03/2014 00:00HR

 

title table:

worker_ref_idworker_titleaffected_from
1Manager20/02/2016 00:00
2Executive11/06/2016 00:00
8Executive11/06/2016 00:00
5Manager11/06/2016 00:00
4Asst. Manager11/06/2016 00:00
7Executive11/06/2016 00:00
6Lead11/06/2016 00:00
3Lead11/06/2016 00:00

 

We need to find the job titles of the highest-paid employees using dax.

Your output should include the highest-paid title or multiple titles with the same salary.

The expected output would be:

worker_titlesalary
Asst. Manager500000
Manager500000
 
Could you please help me in creating a dax?
 
Thanks in advance
2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@sivarajan21 Maybe something like the attached PBIX. You can use either an explicit or implicit MAX coupled with a Top N filter.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.  Mine is a measure based solution without using the Top n filter from the Filter pane.

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.  Mine is a measure based solution without using the Top n filter from the Filter pane.

Hope this helps.

Untitled.png


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

Hi Ash,

 

Thanks for your solution😊

You are welcome.


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

@sivarajan21 Maybe something like the attached PBIX. You can use either an explicit or implicit MAX coupled with a Top N filter.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

Apologise for delay in response!

Thats an amazing solution and you made it look so easy😊

This is what I was looking exactly and I have noted this TOPN function for future reference.

I will accept this as solution and close this query.

 

Thanks a lot to you and beautiful community.

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.