Forum Discussion

dougzecpier's avatar
dougzecpier
New Member
3 years ago
Solved

Reverse cumulative sum

Dear all,

 

I am trying to make a reverse cumulative sum but I am getting an unexpected result. I started with the rationale of the cumulative sum, and it works fine:

Acc Sales = CALCULATE([Sales], FILTER(All('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date])))

It interacts properly with a filter I have in this page and produces the expected chart:

 

 

The problem starts when I try to reverse the cumulative sum:

Reverse Acc Sales = CALCULATE([Sales], FILTER(All('Calendar'), 'Calendar'[Date] >= MIN('Calendar'[Date])))

Doing so I get values starting from the year 1987 and the chart gets really weird:

 

Any ideas on how to solve that?

  • Hi dougzecpier,

     

    The following formula works for me:

     

    Sum = CALCULATE(SUM('Table'[Values]),FILTER(ALL('Calendar'),'Calendar'[Date]>=MIN('Calendar'[Date])))

     

     

    Make sure that the join between your Calendar and Values Table is One to Many and has a single direction filter.

     

    Did I answer your question? Mark this post as a solution if I did!
    Consider taking a look at my blog: Forecast Period - Previous Forecasts

1 Reply

  • Shaurya's avatar
    Shaurya
    Memorable Member

    Hi dougzecpier,

     

    The following formula works for me:

     

    Sum = CALCULATE(SUM('Table'[Values]),FILTER(ALL('Calendar'),'Calendar'[Date]>=MIN('Calendar'[Date])))

     

     

    Make sure that the join between your Calendar and Values Table is One to Many and has a single direction filter.

     

    Did I answer your question? Mark this post as a solution if I did!
    Consider taking a look at my blog: Forecast Period - Previous Forecasts