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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
vasu6811
Frequent Visitor

Last updated Status for each employee based on timestamp

Hi,

 

In my table, I insert employee Id, Status and timestamp with Date. Status can be can be updated frequently (means it can be updated hourly). 

 

How to identify latest Status on an employee on given Date?

1 ACCEPTED SOLUTION

Hi there

 

I got it working with the following measures below.

 

This first one is to get the Latest Status

Latest Status = CALCULATE(MAX('Data'[Datestamp]),ALLSELECTED('Data'[Datestamp]))

The next one is to get the Latest Status ID

Latest Status ID = CALCULATE(MAX('Data'[StatusID]),FILTER('Data','Data'[Datestamp] = MAX('Data'[Datestamp])))

And this is what it looks like when I created it in a table

 

Power BI - DELETE 1.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

4 REPLIES 4
GilbertQ
Super User
Super User

Hi @vasu6811

 

What you could do, is to create a new measure which will be for the MAX of the Status.

 

For example:

Latest Status = MAX('TableName'[Status])




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi guavaq,

 

I have tried your solution. Here problem is Status contains in different table. In employee transaction table, it contains only Status id. I have applied measure on status id. I am getting max of status id. But I expecting last updated status?

 

Here is sample data

 

EmployeeIdStatusIDDatestamp
112017-05-01 11:30:00
132017-05-01 11:35:00
122017-05-01 11:40:00
232017-05-01 11:30:00
222017-05-01 11:35:00
212017-05-01 11:40:00

 

I am expecting result in following format

 

EmployeeIdStatusIDDatestamp
122017-05-01 11:40:00
212017-05-01 11:40:00

Hi there

 

I got it working with the following measures below.

 

This first one is to get the Latest Status

Latest Status = CALCULATE(MAX('Data'[Datestamp]),ALLSELECTED('Data'[Datestamp]))

The next one is to get the Latest Status ID

Latest Status ID = CALCULATE(MAX('Data'[StatusID]),FILTER('Data','Data'[Datestamp] = MAX('Data'[Datestamp])))

And this is what it looks like when I created it in a table

 

Power BI - DELETE 1.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi guavaq,

 

Thanks for solution. It worked for me.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.