Forum Discussion

ashishoza12345's avatar
3 years ago
Solved

Create a new column with previous date after considering 2 separate ID's

Hi Folks,   I need your urgent help on creating a new column "Next Start Date" where it picks up the date from the next row "Start Date" as shown below:     I tried to create a new column ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi ashishoza12345 ,

     

    You can refer to the following steps:

    (1) My test data is the same as yours.

    (2) We can click "New Column" to create two calculate columns:

    Next Start date = 
    var a=CALCULATE (
        MIN ( 'data3'[Start Date]),
        FILTER (
            'data3',
            'data3'[Start Date]> EARLIER ( 'data3'[Start Date])
                 )
        )
    return IF(a<>BLANK(),a,BLANK())
    Next Start date by pass id = 
    var a=CALCULATE (
        MIN ( 'data3'[Start Date]),
        FILTER (
            'data3',
            'data3'[Start Date]> EARLIER ( 'data3'[Start Date]) &&
            'data3'[Pass_id] = EARLIER(data3[Pass_id])
                 )
        )
    return IF(a<>BLANK(),a,BLANK())

    (3) Then we can realize your needs:

    Best Regards,

    Neeko Tang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.