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
Anonymous
Not applicable

running sum of future 3 month data

Hi Team,

Need help in solving the below problem.

We need to take the running sum of future 3 month data based on the month.

DateData 
1/1/201910 
1/5/201920 
1/7/201930 
2/2/20195 
2/15/201945 
2/25/201947 
3/1/201950 
3/6/201920 
3/27/201945 
4/4/201965 
4/25/201935 
4/29/201925 
5/1/201965 
5/10/201940 
6/15/201954 
7/25/201925 
8/24/201936 
   
outputDataComment
Jan-19337Running sum of Feb,march ,April
Feb-19345running sum of march,april,may
Mar-19284Running sum of April ,may ,june
Apr-19184

Running sum of May ,June, July

 

 

Thanks,
Raj

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You will need a Calendar table if you dont have one already. Make sure it has a Year, MonthName, MonthNumber ( to sort month name) column.  

 

Related that to yoru main table on Date (1:M) and make sure to put columns from the Calendar tables as filters ( rows, columns, ect).

 

Then you can write these two measures:

Total of Data = SUM ( Table2[Data] )


Total of Next 3 Months = 
CALCULATE( 
    [Total of Data],
     DATESBETWEEN(
         DimCalendar[Date], 
         LASTDATE(DimCalendar[Date]), 
            DATEADD(
                LASTDATE(DimCalendar[Date]),3,MONTH)
    )
)

And here's the final table:

Sum of Next 3 Months.png

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You will need a Calendar table if you dont have one already. Make sure it has a Year, MonthName, MonthNumber ( to sort month name) column.  

 

Related that to yoru main table on Date (1:M) and make sure to put columns from the Calendar tables as filters ( rows, columns, ect).

 

Then you can write these two measures:

Total of Data = SUM ( Table2[Data] )


Total of Next 3 Months = 
CALCULATE( 
    [Total of Data],
     DATESBETWEEN(
         DimCalendar[Date], 
         LASTDATE(DimCalendar[Date]), 
            DATEADD(
                LASTDATE(DimCalendar[Date]),3,MONTH)
    )
)

And here's the final table:

Sum of Next 3 Months.png

 

 

Hi I used the same data and formula from above. Here is what I come up with: 

best_lina_0-1673365568129.png

I don't understand why Dec-19 has 617 as the next 3 months total. Can you please help? Thank you! 

Anonymous
Not applicable

Hi Nick,,

Can you send me the pbix file.

 

Thanks,

Raj

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.