Forum Discussion

Maram's avatar
Maram
Frequent Visitor
9 years ago
Solved

Cumulative Total

Hello.  I am trying to create a cumulative total for each month but I am getting data per month which I don't want to have. I used this measure

 

Cumulative = CALCULATE(
SUM(Finance[Column CC]),
FILTER(ALL(Finance[Date]), Finance[Date] <= MAX (Finance[Date])))

 

 

Thanks in advance.

  • Anonymous's avatar
    Anonymous
    9 years ago

    Filtering all Finance Table (not only a column), I get the Cumulative for the month, but if you have duplicate dates, the cumulative will be the same, in both.

     

    Cumulative = CALCULATE(
    SUM(Finance[Column CC])
    ,FILTER(ALL(Finance), Finance[Date] <= MAX (Finance[Date])))

     

     

16 Replies

  • I think your formula is correct, so could you please provide more information:

    • Control you are using (charts/table/matrix)
    • Sample data
    • Maram's avatar
      Maram
      Frequent Visitor

      The data is coming from each centre and is collected once every month and is split by Actual and Budget.

      Centre

      Date

      Income

      Staff

      Agency

      Other costs 

      Act/Bud

      1

      31/03/2015

      -2000

      200

      200

      122

      Act

      2

      31/03/2015

      -4000

      100

      100

      100

      Act

      1

      31/03/2015

      -2000

      200

      200

      122

      Bud

      2

      31/03/2015

      -4000

      100

      100

      100

      Bud

      1

      30/04/2015

      -2000

      200

      200

      122

      Act

      2

      30/04/2015

      -4000

      100

      100

      100

      Act

      1

      30/04/2015

      -2000

      200

      200

      122

      Bud

      2

      30/04/2015

      -4000

      100

      100

      100

      Bud

       

      The data is mocked up but you get the general idea.

       

      To get the Column CC I created a cal column which is Column CC = (-Finance[Income] - Finance[Staff] - Finance[Agency]- Finance[Other costs])

       

      I am using bar graph.

       

      I hope it is clear, if not let me know.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    I use the same formula, and works.

     

    Can you take a print? or sample data? The Financial[Date] have 1 date per month?

    More details can help.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Filtering all Finance Table (not only a column), I get the Cumulative for the month, but if you have duplicate dates, the cumulative will be the same, in both.

     

    Cumulative = CALCULATE(
    SUM(Finance[Column CC])
    ,FILTER(ALL(Finance), Finance[Date] <= MAX (Finance[Date])))