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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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

 

 

Anonymous
Not applicable

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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