Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dougzecpier
New Member

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:

Screenshot 2022-10-16 121131.png 

 

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:
Screenshot 2022-10-16 121631.png

 

Any ideas on how to solve that?

1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @dougzecpier,

 

The following formula works for me:

 

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

 

Screenshot 2022-10-17 031317.jpg

 

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

View solution in original post

1 REPLY 1
Shaurya
Memorable Member
Memorable Member

Hi @dougzecpier,

 

The following formula works for me:

 

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

 

Screenshot 2022-10-17 031317.jpg

 

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.