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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.