Forum Discussion
Conditional calculation based on previous record
- 4 years ago
Hi Anonymous ,
Please try this Calculated column.
Flagged_CalculatedColumn = VAR Count_ = CALCULATE ( COUNT ( 'Table'[Transportation ID] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Transportation] ), 'Table'[Activity ] = "Enroute" && EARLIER('Table'[Activity ]) = "Waiting" ) ) RETURN IF ( ISBLANK ( Count_ ), "", " JIT - Flagged" )Then, the visual should look like this.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi Anonymous ,
Not very clear about the calculation logic, but you may try this Measure.
Flagged =
VAR Count_ =
CALCULATE (
COUNT ( 'Table'[Transportation ID] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Transportation] ),
'Table'[Activity ] = "Enroute"
&& MAX ( 'Table'[Activity ] ) = "Waiting"
)
)
RETURN
IF ( ISBLANK ( Count_ ), "", " JIT - Flagged" )
Then, the result should look like this.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know whether the result will be impacted by transportation methods or transportation ID . Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
- Anonymous4 years agoNot applicable
Hi v-cazheng-msft thanks for your help. Do you think I can implement this as a column? rather than measure? Thanks again.
- v-cazheng-msft4 years agoCommunity Support
Hi Anonymous ,
Please try this Calculated column.
Flagged_CalculatedColumn = VAR Count_ = CALCULATE ( COUNT ( 'Table'[Transportation ID] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Transportation] ), 'Table'[Activity ] = "Enroute" && EARLIER('Table'[Activity ]) = "Waiting" ) ) RETURN IF ( ISBLANK ( Count_ ), "", " JIT - Flagged" )Then, the visual should look like this.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun