Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Second latest date with data

Hi,    I have a measure that shows data from the latest possible day and it works as expected. Somehow I fail building a measure for the second latest date because it is always showing data for the...
  • VahidDM's avatar
    4 years ago

    Hi Anonymous 

     

    try this:

    VAR _2nd =
        CALCULATE (
            MAX ( 'Table'[timestamp] ),
            FILTER ( ALL ( 'Table' ), 'Table'[timestamp] < MAX ( 'Table'[timestamp] ) )
        )
    RETURN
        CALCULATE ( SUM ( 'Table'[count] ), 'Table'[timestamp] = _2nd )

    output:

     

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

    Appreciate your Kudos!!