Forum Discussion

Alpha1029's avatar
Alpha1029
New Member
7 years ago
Solved

Cumulative Total till today

      Hi    I want to get cumulative totals according to the dates till today and for all the future dates cumulative total should be shown as zero or blank. I went through some examples but those...
  • dedelman_clng's avatar
    7 years ago

    Try this:

     

    Running Total =
    var __MaxDT = max(Table[Date])
    var __Rtotal = 
      CALCULATE(SUM(Table[Value]),
        Filter(All(Table), Table[Date] <= __MaxDT)
    )
    
    RETURN
    IF (__MaxDT > TODAY(), 0, __Rtotal)

    Hope this helps

    David

  • dedelman_clng's avatar
    dedelman_clng
    7 years ago

    Alpha1029It needs to be created as a measure, not a calculated column.  The measure can be added to a visual table as a column.