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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ConnorH
Microsoft Employee
Microsoft Employee

Lead and Lag Help

I am getting really close to solvbing my issue but there is just one more peice I can not figure out. I was able to pull the Latest date where ProjectID=ProjectID and Status=Status. I still do not know how to set this equation up to only keep one value per status per project ID. So for example In the first row of the table below the ProjectID 34631 with the status 2.1, modified 6/1/20  [Last status date] should be blank because there is a later date with the same project ID and Status.

 

ProjectIDStatus ExtractModifiedLast Status Date (New column)
346312.16/1/20 
346312.16/4/206/4/20
346314.06/20/206/20/20

 

"Last status date =
var _ProjectID = 'Status'[ProjectID]
var _Status = 'Status'[Status Extract]
Var _StatusDate = 'Status'[Modified]
var _LaterDate = MAXX(FILTER('Status','Status'[ProjectID] = _ProjectID && 'Status'[Status Extract] = _Status), 'Status'[Modified])

Return _LaterDate"
 
 
this equation will make the table like this and it wont leave the values blank.
ProjectIDStatus ExtractModifiedLast Status Date (New column)
346312.16/1/206/4/20
346312.16/4/206/4/20
346314.06/20/206/20/20
1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Last status date =
var _ProjectID = 'Status'[ProjectID]
var _Status = 'Status'[Status Extract]
Var _StatusDate = 'Status'[Modified]
var _LaterDate = MAXX(FILTER('Status','Status'[ProjectID] = _ProjectID && 'Status'[Status Extract] = _Status), 'Status'[Modified])

Return IF(_LaterDate=_StatusDate,_LaterDate)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@ConnorH , Try a new column like

maxx(filter(Table, [ProjectID] =earlier([ProjectID]) && [Status Extract] =earlier([Status Extract])),[Modified] )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
wdx223_Daniel
Super User
Super User

Last status date =
var _ProjectID = 'Status'[ProjectID]
var _Status = 'Status'[Status Extract]
Var _StatusDate = 'Status'[Modified]
var _LaterDate = MAXX(FILTER('Status','Status'[ProjectID] = _ProjectID && 'Status'[Status Extract] = _Status), 'Status'[Modified])

Return IF(_LaterDate=_StatusDate,_LaterDate)

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.