Forum Discussion

smithub's avatar
smithub
Helper I
2 years ago
Solved

Earliest Date

Hi all!!

I'm trying to create a measure or a column (whichever is better) to identify the earliest date for each Case ID at each stage.  See below sample data

 

Case IDStageDate
1617358Stage 115/03/2023
1617358Stage 118/03/2023
1617358Stage 214/03/2023
1617358Stage 315/05/2023
1617358Stage 329/05/2023
1617358Stage 412/05/2023
1617358Stage 429/05/2023
1617358Stage 406/07/2023
1617358Stage 409/08/2023
1618597Stage 114/05/2023
1618597Stage 119/05/2023
1618597Stage 211/06/2023
1618597Stage 219/07/2023
1618597Stage 223/08/2023
1618597Stage 318/06/2023
1618597Stage 327/08/2023
1618597Stage 420/05/2023
1618597Stage 427/07/2023

 

I would like to get this:

 

Case IDStageDate
1617358Stage 115/03/2023
1617358Stage 214/03/2023
1617358Stage 329/05/2023
1617358Stage 412/05/2023
1618597Stage 114/05/2023
1618597Stage 211/06/2023
1618597Stage 318/06/2023
1618597Stage 420/05/2023

 

Appreciate any help on this thanks.

  • Hi smithub ,

     

    Try this as either a calc column or a measure:

     

    EARLIEST DATE =
    CALCULATE (
        MIN ( 'table'[Date] ),
        ALLEXCEPT ( 'table', 'table'[Case ID], 'table'[State] )
    )
    

     

2 Replies

  • Hi smithub ,

     

    Try this as either a calc column or a measure:

     

    EARLIEST DATE =
    CALCULATE (
        MIN ( 'table'[Date] ),
        ALLEXCEPT ( 'table', 'table'[Case ID], 'table'[State] )
    )