Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Find the next Stop Date

Hi,   I try to find the next "Stop Date". I have got the following structure   Position Type Start Date 10 End 07.11.2019 23:58 10 End 07.11.2019 23:57 10 Start 07.11.2019 23:...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    You can use the following measure formula to achieve your requirement:

    NextDate =
    VAR currType =
        SELECTEDVALUE ( 'Table'[Type] )
    RETURN
        IF (
            currType = "Start",
            CALCULATE (
                MIN ( 'Table'[Start Date] ),
                FILTER ( ALLSELECTED ( 'Table' ), [Start Date] > MAX ( 'Table'[Start Date] ) ),
                VALUES ( 'Table'[Position] )
            )
        )
    

    Regards,

    Xiaoxin Sheng