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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
michael_ma
Frequent Visitor

Help with Dax query to find cumulative total for every 3 months

Hi guys, 

 

I have this dax function that takes the cumulative sum of a measure. I want to keep the cumulative sum, but have it reset every 3 months. Does anyone have an idea on how to modify what I currently have to rest cumulative sum for every 3 months?

 

michael_ma_0-1709842676604.png

 

1 ACCEPTED SOLUTION
michael_ma
Frequent Visitor

Ok I think I figured out the syntax. Turns out I just needed to partition by quarter. 

 

cumulative sum = CALCULATE([expected revenue sum],
                                WINDOW(
                                    1,ABS,
                                    0,REL,
                                    SUMMARIZE(
                                        ALLSELECTED(BDX_NEW_BUSINESS_TARGETS), 
                                                    BDX_NEW_BUSINESS_TARGETS[rolling_date_test],
                                                    BDX_NEW_BUSINESS_TARGETS[rolling_date_test].[Quarter]),
                                    ORDERBY(BDX_NEW_BUSINESS_TARGETS[rolling_date_test]),,PARTITIONBY(BDX_NEW_BUSINESS_TARGETS[rolling_date_test].[Quarter])))

michael_ma_0-1709849610729.png

 

 

View solution in original post

1 REPLY 1
michael_ma
Frequent Visitor

Ok I think I figured out the syntax. Turns out I just needed to partition by quarter. 

 

cumulative sum = CALCULATE([expected revenue sum],
                                WINDOW(
                                    1,ABS,
                                    0,REL,
                                    SUMMARIZE(
                                        ALLSELECTED(BDX_NEW_BUSINESS_TARGETS), 
                                                    BDX_NEW_BUSINESS_TARGETS[rolling_date_test],
                                                    BDX_NEW_BUSINESS_TARGETS[rolling_date_test].[Quarter]),
                                    ORDERBY(BDX_NEW_BUSINESS_TARGETS[rolling_date_test]),,PARTITIONBY(BDX_NEW_BUSINESS_TARGETS[rolling_date_test].[Quarter])))

michael_ma_0-1709849610729.png

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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