Forum Discussion
liechpa
7 years agoRegular Visitor
Looking for a end timestamp
Hi folks
I have the following table with the columns "product", "order_nr", "state_start", "from_state", "to_state" and "state".
I want to calculate the column "state_end" which is always the closest timestamp (depending on the column "product", "order_nr" and "from_state").
If the status is not left, state_end=state_start.
I hope someone can help me
Thanks
Hi liechpa ,
To create two calculated columns as below.
final date = IF(ISBLANK('Table'[state_end]),'Table'[state_start],'Table'[state_end])max date = CALCULATE ( MAX ( 'Table'[final date] ), FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) && 'Table'[order_nr] = EARLIER ( 'Table'[order_nr] ) && 'Table'[from_state] = EARLIER ( 'Table'[from_state] ) ) )
2 Replies
- v-frfei-msft
Community Support
Hi liechpa ,
To create two calculated columns as below.
final date = IF(ISBLANK('Table'[state_end]),'Table'[state_start],'Table'[state_end])max date = CALCULATE ( MAX ( 'Table'[final date] ), FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) && 'Table'[order_nr] = EARLIER ( 'Table'[order_nr] ) && 'Table'[from_state] = EARLIER ( 'Table'[from_state] ) ) )