Forum Discussion

Kristofferaabo's avatar
8 years ago
Solved

Cumulative sum for a line chart

Hi,

 

I have a set of data with a a column of meeting dates each for a 'sale', I would like to make a chart visualizing this sale growing over time. (cumulative sum??)

 

Y axis total sale (count of the sale=, X axis meeting date

Please find a screenshot of my dataset

 

Thanks

Kristoffer

 

 

  • Hi Kristofferaabo,

     

    You could create the measure below to get the cumulative sum of the sales.

     

    total =
    CALCULATE (
        SUM ( table5[count of sales] ),
        FILTER (
            ALL ( table5 ),
            'table5'[Meeting date] <= MAX ( 'table5'[Meeting date] )
        )
    )

     Then you will get your excepted line chart.

     

     

    Best Regards,

    Cherry

6 Replies

  • deldersveld's avatar
    deldersveld
    Icon for Resident Rockstar rankResident Rockstar

    Try the "Running Total" Quick Measure and total it over date.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the quick solution 🙂

    • juliarwk's avatar
      juliarwk
      Frequent Visitor

      Thanks a lot!! This was an easy solution that saved me a lot of time.

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Kristofferaabo,

     

    You could create the measure below to get the cumulative sum of the sales.

     

    total =
    CALCULATE (
        SUM ( table5[count of sales] ),
        FILTER (
            ALL ( table5 ),
            'table5'[Meeting date] <= MAX ( 'table5'[Meeting date] )
        )
    )

     Then you will get your excepted line chart.

     

     

    Best Regards,

    Cherry

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-piga-msft 

      Would it be possible to add a grouping condition to that. Say I have a column category, then I would like the cummulative sum to be at a category level.