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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sander_NL
Helper I
Helper I

Table with actual status and how to go back in time with a lifecycle change table

Good day, I have two tables:

 

A table with all apps, controls, status fields. This is a table which is refreshed everyday with the status of current day. In a second table I have status changes with a date of change (multiple time a day is possible even on seconds on the same day). When there is no update then the value of the first table (most recent value is applicable). 

 

I need to be able to go back in time with a date slicer. I did already experiment with a date table but not having success. The tables have a related based on a key app | control. Below some example data including the expected outcome. 

 

Can anyone assist?

 

 

Table all controls (values as of today e.g. 31-1-2024)  which are daily refreshed)
       
KeyAppControlStatus   
AABS1AABS19   
AABS2AABS28   
CAHS1CAHS17   
CAHS2CAHS29   
CAHS3CAHS31   
JKLS1JKLS14   
       
Table lifecycle (only when a status changes there is a entry)
KeyAppControlOld statusNew statusDateUpdated
AABS1AABS16915-01-2024 13:00
AABS2AABS25815-01-2024 14:00
CAHS2CAHS29121-01-2024 11:00
CAHS2CAHS21921-01-2024 14:00
       
Examples of output     
Slicer on  31-01-2024    
KeyAppControlStatus   
AABS1AABS19   
AABS2AABS28   
CAHS1CAHS17   
CAHS2CAHS29   
CAHS3CAHS31   
JKLS1JKLS14   
       
Slicer on 14-01-2024    
KeyAppControlStatus   
AABS1AABS16   
AABS2AABS25   
CAHS1CAHS17   
CAHS2CAHS26   
CAHS3CAHS31   
JKLS1JKLS14   
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sander_NL ,

First of all, I want to ask why it is 6 here:

vjunyantmsft_7-1713405568259.png

None of the records in the sample data you provided have CAHS2 = 6.


I suggest you to merge the two tables as a new one in Power Query:

vjunyantmsft_1-1713405300239.png

vjunyantmsft_0-1713405275914.png
Click "Close and Apply":

vjunyantmsft_2-1713405342291.png

I add a calendar table for slicer:

vjunyantmsft_3-1713405390000.png

And here is the relationship view:

vjunyantmsft_4-1713405406536.png

Then use this DAX to create a measure:

Status_Dynamic = 
IF(
    MAX('Merge_PowerQuery'[DateUpdated]) = BLANK(),
    MAX('Merge_PowerQuery'[Status]),
    IF(
        MAX('Merge_PowerQuery'[DateUpdated]) >= SELECTEDVALUE('Calendar'[Date]),
        MAX('Merge_PowerQuery'[Old status]),
        MAX('Merge_PowerQuery'[Status])
    )
)

The final output is as below:

vjunyantmsft_5-1713405493689.png

vjunyantmsft_6-1713405517385.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Sander_NL ,

First of all, I want to ask why it is 6 here:

vjunyantmsft_7-1713405568259.png

None of the records in the sample data you provided have CAHS2 = 6.


I suggest you to merge the two tables as a new one in Power Query:

vjunyantmsft_1-1713405300239.png

vjunyantmsft_0-1713405275914.png
Click "Close and Apply":

vjunyantmsft_2-1713405342291.png

I add a calendar table for slicer:

vjunyantmsft_3-1713405390000.png

And here is the relationship view:

vjunyantmsft_4-1713405406536.png

Then use this DAX to create a measure:

Status_Dynamic = 
IF(
    MAX('Merge_PowerQuery'[DateUpdated]) = BLANK(),
    MAX('Merge_PowerQuery'[Status]),
    IF(
        MAX('Merge_PowerQuery'[DateUpdated]) >= SELECTEDVALUE('Calendar'[Date]),
        MAX('Merge_PowerQuery'[Old status]),
        MAX('Merge_PowerQuery'[Status])
    )
)

The final output is as below:

vjunyantmsft_5-1713405493689.png

vjunyantmsft_6-1713405517385.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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