Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Break down Running Total into separate cases

Hello Everybody,   I've seen lots of explanations to create a running/accumulating total, however the raw data I have begins with a running total and I would like break this down to the value added...
  • camargos88's avatar
    6 years ago

    Hi Anonymous ,

     

    Try this code for a calculated column:

     

    Column = 
    VAR _previousDate = CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[Date] < EARLIER('Table'[Date])))
    RETURN
         'Table'[Values] - CALCULATE(SUM('Table'[Values]), FILTER('Table', 'Table'[Date] = _previousDate))