Forum Discussion

PowerUser123's avatar
PowerUser123
Helper II
4 years ago
Solved

Cumulative Sum - Adjusted Value Each Day

So I created a measure called Win Loss which is just the sum of sales - 250,000 which can be seen in the 2nd column below. I wanted to create a running total of this win loss, but I don't think the m...
  • amitchandak's avatar
    4 years ago

    PowerUser123 , Try like

     

    Win Loss Run = CALCULATE(sumx(values('Calendar'[Date]),[Win Loss]),FILTER(ALLSELECTED('Calendar'[Date]),'Calendar'[Date]<=MAX('Calendar'[Date])))

  • davehus's avatar
    4 years ago

    Hi PowerUser123 ,

     

    Try this.

     

    Running Total =
    VarLastDate =LASTDATE('Date Table'[DateKey])
    return CALCULATE(sum('Table'[Value]),ALLEXCEPT('Date Table','Date Table'[DateKey]),'Date Table'[DateKey]<=VarLastDate)