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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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