Forum Discussion

M_SBS_6's avatar
M_SBS_6
Helper V
2 years ago
Solved

Second latest Date

Hi, I have the following measure which pulls the value based on the max date.    Measure= Calculate (sum( app[val], filter(app[date] = MAX (app[date])))   This brings back 01/12/2023.   The pr...
  • Ahmedx's avatar
    2 years ago

    Try this

    Measure = VAR _Datesecond = MINX(TOP(2,ALL('app'[Date]),'app'[Date],DESC),'table'[Date])
    RETURN
    CALCULATE(sum(app[val]),FILTER(ALL('app'),'app'[Date]=_Datesecond))