Forum Discussion

JamesGordon's avatar
JamesGordon
Icon for Helper II rankHelper II
6 years ago

Cumulative Totals

Hi,

 

I am struggling to calculate cumulative totals. Hopefully someone can help!

 

I have a measure that i have created to calculate the total value of sales YTD (fromt Oct 2019 to today) - this is the measure i am basing my cumulative totals off if possible? (FYI this measure works for calculating YTD sales value)

 

Total All Sales YTD = CALCULATE(SUM('Sheet (2)'[Total Sell]), FILTER('Sheet (2)', 'Sheet (2)'[Status] = "S"), filter('Sheet (2)', 'Sheet (2)'[Total Cost]>100))
 
I am looking to use this measure as the basis for my cumulative totals to ensure it uses the correct values. I have tried to add the ALL filter as per previous
posts to start the cumulative values but having no luck.
 
Here is the measure i have tried to create but get the below error:
 
Cumulative test = CALCULATE(SUM('Sheet (2)'[Total Sell]), FILTER('Sheet (2)', 'Sheet (2)'[Status] = "S"), filter('Sheet (2)', 'Sheet (2)'[Total Cost]>100),all('Sheet (2)'[Inv date].[Date])<=MAX('Sheet (2)'[Inv date].[Date]))
 
 
 
Am i on the right track or completely off course?
 

16 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi JamesGordon 

    i think you can use much more simple version

    Cumulative test = CALCULATE(SUM('Sheet (2)'[Total Sell]), 'Sheet (2)'[Status] = "S", 'Sheet (2)'[Total Cost]>100 , 'Sheet (2)'[Inv date]<=MAX('Sheet (2)'[Inv date]) )
    • JamesGordon's avatar
      JamesGordon
      Icon for Helper II rankHelper II

      Thanks Az38,

       

      I have tried your suggestion but get the following error?

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        Hi JamesGordon 

        you did not use my suggestion, i see a lot of filters in your statement