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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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