Forum Discussion

Boycie92's avatar
Boycie92
Resolver I
6 years ago
Solved

Second Last Date Total

Hi,   I am hoping someone can help I have a very simple table.   I would like to be able to create a measure that would provide the figure (total) for the second last date available in my data. S...
  • amitchandak's avatar
    6 years ago

    Boycie92 

    measure =
    var _max= maxx(allselected(Table),Table[date])
    return
    calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),Table[Date]<_max)

     

    OR


    measure =
    var _max= maxx(allselected(Table),Table[date])
    return
    calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),filter(allselected(Table),Table[Date]<_max))