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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Max Salary for employes table which has duplicate records

Hi 

I have data like below

Emp_NumJoin DateHike DateResgn_DateSalary
111-09-201812-12-2020#N/A20000
111-09-201819-09-2021#N/A28000
111-09-201810-10-2023#N/A52000
223-07-202110-10-2022#N/A30000
223-07-202112-12-2023#N/A42000
309-09-202010-10-2021#N/A20000
309-09-202011-06-202311-09-202325000

 

I want to show in a bar chart like gropus salry 20-25000 and 25-30000, 30-35000 bins and the employe where he got the last hike that employee should come in that bin

Emp_NumHike Date Salary
110-10-202352000
223-07-2021 42000
311-06-202342000
2 ACCEPTED SOLUTIONS
jeremic_nikola
Frequent Visitor

The simplest solution would be to create additional column (IsMaxDateHire)

IsMaxHireDate = 
VAR _EMP = [Id]
VAR _MAXDATE = 
CALCULATE(
    MAX(Emp[HireDate]),
    REMOVEFILTERS(),
    Emp[Id] = _EMP
)
RETURN  [HireDate] = _MAXDATE

 Then in your visual simply filter when this column is true.

jeremic_nikola_0-1697025676430.png

You can do by using measure instead of the column as well, but you will need to take care of which filters you remove and which not, if you want to implement this as a measure you need to see what are your use cases (what you will be using as dimension/filter).

 

Was this helpful?

View solution in original post

Anonymous
Not applicable

2 REPLIES 2
Anonymous
Not applicable

Thank you jeremic_nikola

 

It worked.

 

jeremic_nikola
Frequent Visitor

The simplest solution would be to create additional column (IsMaxDateHire)

IsMaxHireDate = 
VAR _EMP = [Id]
VAR _MAXDATE = 
CALCULATE(
    MAX(Emp[HireDate]),
    REMOVEFILTERS(),
    Emp[Id] = _EMP
)
RETURN  [HireDate] = _MAXDATE

 Then in your visual simply filter when this column is true.

jeremic_nikola_0-1697025676430.png

You can do by using measure instead of the column as well, but you will need to take care of which filters you remove and which not, if you want to implement this as a measure you need to see what are your use cases (what you will be using as dimension/filter).

 

Was this helpful?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.