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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JordanCline
New Member

Cumulative Sum which resets based on a custom fiscal quarter

I've searched and searched and haven't found a thread with a solution that works for my specific issue.  I have a table with 1 million+ rows of sales data.  I need to create a measure that will give me the cumulative total of closed deals for each quarter.   I have a Sales Data table and a Calendar table that are related through [Close Date] from the Sales Data table and [DayOfCalendarDate] from the Calendar table.  My companies fiscal quarters/years don't line up to the normal calendar.  The two closest solutions I've come up with are: 

 

= CALCULATE(SUM('Sales Data'[Value]),FILTER(ALL('Calendar'[DayOfCalendarDate]),'Calendar'[DayOfCalendarDate]<=MAX('Calendar'[DayOfCalendarDate])))
Which gives me a cumulative total, but doesn't reset each quarter
 
JordanCline_0-1690928548227.png

 

And the other is 

= CALCULATE(SUM('Sales Data'[Value]),FILTER(ALL('Sales Data'),  'Sales Data'[Week in Quarter]<=MAX('Sales Data'[Week in Quarter]) ),'Sales Data'[Value] )
Where I created a custom Column in my Sales Data table to show the "Week in Quarter".  This one resets each quarter, but each quarter is the sum of all quarters.  
 
JordanCline_1-1690928911635.png

I have a column in the Sales Data table with the fiscal quarter mapped based on the close date, but all my attempts to add that as a filter in the expression haven't helped.

 

Please help!

1 REPLY 1
vicky_
Super User
Super User

It's giving you the sum of all quarters because you haven't kept the filter for each quarter in. To fix it, you'll need to add the condition 'Sales Data'[Quarter] = SELECTEDVALUE('Sales Data'[Quarter]) or something like that into formula.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.