Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Get second earliest date in a column

Hi community,  I'd like to get the second earliest date in a column of date type. I'm trying the following formula but I'm still getting the earliest, not the second earliest.    second earliest ...
  • PaulDBrown's avatar
    5 years ago
    Try:
     
    second earliest date =
    VAR mindate =
    CALCULATE ( MIN ( 'Table'[column] ), ALLSELECTED ( 'Table' ) )
    RETURN
    CALCULATE (
    MIN ( 'Table'[column] ),
    FILTER ( ALLSELECTED ( 'Table'), 'Table'[column] > mindate )
    )