Forum Discussion

DanCasSan's avatar
DanCasSan
Icon for Helper V rankHelper V
6 years ago
Solved

Disaggregate accumulated

Hello community.   How could I get the highlighted field? What happens is that I have the accumulated information per day, but I need to know the value of the day. I have attached an example table....
  • az38's avatar
    6 years ago

    Hi DanCasSan 

    try a column

    Column = 
    var _prevDate = CALCULATE(MAX(Table[Date]), FILTER(ALL(Table), Table[CountryName] = EARLIER(Table[CountryName]) && Table[Date] < EARLIER(Table[Date]) ) )
    var _thisVal = EARLIER(Table[ValueAccuum])
    RETURN
    _thisVal - CALCULATE(MAX(Table[ValueAccuum]), ALLEXCEPT(Table, Table[CountryName]), Table[Date] = _prevDate )