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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
lingleji
Frequent Visitor

Cumulative totals not working in calculation group but working in a measure

Hi super users.  I've got a cumulative total calculation that works as a measure, but when I try to use it (even modified), it isn't returning the correct values.  

This measure is working.

Cumulative Revenue =

VAR MonthStart = DISTINCT (
SELECTCOLUMNS (
FILTER('Fiscal Calendar', 'Fiscal Calendar' [Calendar_Date] = Today()-1) ,
"Fiscal Calendar", [Month_Start_Date]
))

RETURN CALCULATE ([Total Revenue],
 FILTER(ALLSELECTED('Collected Payments'),
'Collected Payments'[Invoice Closed Date] <= MAX('Collected Payments'[Invoice Closed Date])
))

 

This is what I've tried using in the Calculation Group for Cumulative Revenue, but it just returns the total for the current day.

VAR MonthStart = DISTINCT ( SELECTCOLUMNS ( FILTER('Fiscal Calendar', 'Fiscal Calendar' [Calendar_Date] = Today()-1) , "Fiscal Calendar", [Month_Start_Date] )) RETURN CALCULATE (SUM('Collected Payments'[Amount]), --[Total Revenue], FILTER(ALLSELECTED('Collected Payments'), 'Collected Payments'[Invoice Closed Date] <= MAX('Collected Payments'[Invoice Closed Date]) 

 Cumulative Actuals - Working.PNG

 

Cumulative Actuals.PNG

Any help would be greatly appreciated.  Thanks in advance!

2 REPLIES 2
liuqi_pbi
Resolver III
Resolver III

Hi @lingleji 

 

The variable MonthStart is not used in your measure, what is it created for? 

 

For the cumulative total in calculation group, the solution in the following thread may be helpful. You could give it a try. 

Calculation groups for cumulative total DAX Pattern - Microsoft Power BI Community

 

----------------------------------------------------------------------

If this reply helps solve the problem, please mark it as Solution! Kudos are appreciated too!

DataInsights
Super User
Super User

@lingleji,

 

If you want the cumulative total to reset at the end of each year, you can use a year-to-date calculation:

 

Cumulative Revenue =
CALCULATE (
    SUM ( 'Collected Payments'[Amount] ),
    DATESYTD ( 'Fiscal Calendar'[Calendar_Date] )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors