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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rkumar26
Regular Visitor

Based on duration selection and Selection of latest Designation

Hi,

I am new to powerBI. I am trying to create measure to select  employee latest designation based on selected time duration. I got confused how to write function for the same. Please help me.

Example is as below:

DateEmployee NameDesignationOther data1
01-04-2021Name1C 
01-06-2021Name2C 
01-07-2021Name3B 
01-04-2022Name1B 
02-04-2022Name5C 
03-04-2022Name6C 
04-04-2022Name1A 
05-04-2022Name8B 
06-04-2023Name5B 
07-04-2023Name10B 
08-05-2023Name6B 
09-08-2023Name5A 
10-08-2023Name10B 
11-10-2023Name5A 
12-11-2023Name6A 

 

Thank you.

Regards,

Rkumar

2 REPLIES 2
amitchandak
Super User
Super User

@rkumar26 , Try one of the two measures

 

Last Status = var _max = maxx(filter(ALLSELECTED(Data), Data[Employee Name] = Max(Data[Employee Name])), Data[Date])
return
CALCULATE(max(Data[Designation]), filter((Data) , Data[Date] =_max))

 

or

 

Last Status = var _max = maxx(filter(ALLSELECTED(Data), Data[Employee Name] = Max(Data[Employee Name])), Data[Date])
return
CALCULATE(max(Data[Designation]), filter(ALLSELECTED(Data), Data[Employee Name] = Max(Data[Employee Name]) && Data[Date] =_max))

 

 

refer

https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit, 

Thanks for quick response.
Above code is working to show latest desgnation.
Other data 1, lets say hours are summed as per old input of designation, when using slicer for designation. 
I was trying to show sum of hours also in same designation when selected.

 

Thanks you for help.
regards,

Rkumar

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.