Forum Discussion
How to flag status change
- 5 years ago
Hi deanbland ,
Please try the following formula:
Column = var PreDate = MAXX( FILTER( 'Table', 'Table'[Date] < EARLIER('Table'[Date]) && 'Table'[ID] = EARLIER('Table'[ID]) ), 'Table'[Date] ) var PD_Status = CALCULATE( MAX('Table'[Status]), FILTER( 'Table', 'Table'[Date] = PreDate && 'Table'[ID] = EARLIER('Table'[ID]) ) ) return IF( PD_Status = BLANK() || PD_Status = 'Table'[Status], 0, 1 )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Worked on this at same time. Here is a measure expression you can try too.
StatusChange =
VAR latestdate =
MAX ( 'Status'[Date] )
VAR lateststatus =
CALCULATE ( MIN ( 'Status'[Status] ), 'Status'[Date] = latestdate )
VAR prevdate =
CALCULATE ( MAX ( 'Status'[Date] ), 'Status'[Date] < latestdate )
VAR prevstatus =
CALCULATE ( MIN ( 'Status'[Status] ), 'Status'[Date] = prevdate )
RETURN
IF ( ISBLANK ( prevstatus ) || prevstatus = lateststatus, "N", "Y" )
Pat