Forum Discussion
Anonymous
5 years agoNot applicable
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 ...
- 5 years agoTry:second earliest date =VAR mindate =CALCULATE ( MIN ( 'Table'[column] ), ALLSELECTED ( 'Table' ) )RETURNCALCULATE (MIN ( 'Table'[column] ),FILTER ( ALLSELECTED ( 'Table'), 'Table'[column] > mindate ))
amitchandak
Super User
5 years agoAnonymous , Try like
second earliest date =
VAR mindate =
CALCULATE ( MIN ( 'Table'[column] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
MIN ( 'Table'[column] ),
FILTER ( ALL ( 'Table'), 'Table'[column] > mindate )
)
or create a column rank and filter for 2
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns