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
devpp
New Member

Cumulative sum of columns/year

Hello Community,
How can I find the cumulative sum of Plan and Actual column for the coloured period (month_year) using DAX.

The below screenshot is from Excel. 

devpp_1-1739891910267.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @devpp,

If you want ot the cumulative causation cut off at the year end, I'd like to suggest add a condition to check the current year.
I modify the above formulas to add the filter condition on year to the two expressions:

Cumm Planned =
CALCULATE (
    SUM ( Table[Plan] ),
    FILTER (
        ALL ( Table ),
        Table[month_year] <= EARLIER ( Table[month_year] )
            && YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
    )
)

Cumm Actual =
CALCULATE (
    SUM ( Table[Actual] ),
    FILTER (
        ALL ( Table ),
        Table[month_year] <= EARLIER ( Table[month_year] )
            && YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
    )
)

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @devpp ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

bhanu_gautam
Super User
Super User

@devpp 

Cumulative Planned:
DAX
Cumm Planned =
CALCULATE(
SUM(Table[Plan]),
FILTER(
ALL(Table),
Table[month_year] <= EARLIER(Table[month_year])
)
)


Cumulative Actual:
DAX
Cumm Actual =
CALCULATE(
SUM(Table[Actual]),
FILTER(
ALL(Table),
Table[month_year] <= EARLIER(Table[month_year])
)
)

 

Table is the name of your table.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi bhanu_gautam,

The answer is close...here I need to find the cumulative for that year only...In this case it should stop at 172 when 2024 completes and then start fresh for 2025.

For 2025 in the control year it should start from 7 and end at 13

devpp_0-1739943203314.png

 

Anonymous
Not applicable

Hi @devpp,

If you want ot the cumulative causation cut off at the year end, I'd like to suggest add a condition to check the current year.
I modify the above formulas to add the filter condition on year to the two expressions:

Cumm Planned =
CALCULATE (
    SUM ( Table[Plan] ),
    FILTER (
        ALL ( Table ),
        Table[month_year] <= EARLIER ( Table[month_year] )
            && YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
    )
)

Cumm Actual =
CALCULATE (
    SUM ( Table[Actual] ),
    FILTER (
        ALL ( Table ),
        Table[month_year] <= EARLIER ( Table[month_year] )
            && YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
    )
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.