cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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!:
Mastering Power BI 2nd Edition

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!:
Mastering Power BI 2nd Edition

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors