Forum Discussion

Applicable88's avatar
Applicable88
Impactful Individual
4 years ago
Solved

Running Total without calculate?

Hello,

is there a way to compute running total without the calculate function? For example via creating a table variable inside a measure and sum it up via sumx?

With this sample data:

 

Date Sales
01.01.2021 123
02.01.2021 423
03.01.2021 535
04.01.2021 66
05.01.2021 22
06.01.2021 11
07.01.2021 11
08.01.2021 33
09.01.2021 44

Thank you very much in advance. 

 

 

Best. 

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Applicable88 Yes:

    Measure =
      VAR __Date = MAX('Table'[Date])
    RETURN
      SUMX(FILTER(ALL('Table',[Date] <= __Date),[Sales])
    • CNENFRNL's avatar
      CNENFRNL
      Community Champion

      No doubt, it's your most favooooooooorite way to kick off CALCULATE. ðŸ¤£

    • pstaggers's avatar
      pstaggers
      Advocate II

      Just me, or is there a missing paren in this?

       

      Measure =
      VAR __Date = MAX('Table'[Date])
      RETURN
      SUMX(FILTER(ALL('Table',[Date] <= __Date),[Sales])