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
JaclynPugh2022
Helper II
Helper II

Rolling 3 Month Forecast VAR - Does Not Want SUM of all Months in Total just Latest Month

I have a rolling monthly forecast formula showing monthly totals, but it is summing all the month values together at the total level and I do not want that.  I want it to show total sum of the current month.  What do I have to do to modify the total level value?

 

Spend Forecast based on last 3 Mo =
VAR Spend1MonthAgo = CALCULATE([Received Spend], DATEADD('DimDate1'[Date],-1, MONTH ) )
VAR Spend2MonthsAgo = CALCULATE([Received Spend], DATEADD('DimDate1'[Date],-2, MONTH ) )
VAR Spend3MonthsAgo = CALCULATE([Received Spend], DATEADD('DimDate1'[Date],-3, MONTH ) )
RETURN
DIVIDE( Spend1MonthAgo + Spend2MonthsAgo + Spend3MonthsAgo, 3 , 0 )
 
 
Result:
 
January: $100
February: $150
March: $100
Total Level: $350  <----This needs to display current month total, not a sum of all months.
 
Thank you
 
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@JaclynPugh2022 , Try a measure like example

 

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-3,MONTH))

View solution in original post

v-kkf-msft
Community Support
Community Support

Hi @JaclynPugh2022 ,

 

Please try the measure.

 

Spend Forecast based on last 3 Mo = 
CALCULATE (
    [Received Spend],
    DATESINPERIOD (
        DimDate1[Date],
        EOMONTH ( MAX ( 'Table'[Date] ), -1 ),
        -3,
        MONTH
    )
) / 3

vkkfmsft_0-1657609422937.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @JaclynPugh2022 ,

 

Please try the measure.

 

Spend Forecast based on last 3 Mo = 
CALCULATE (
    [Received Spend],
    DATESINPERIOD (
        DimDate1[Date],
        EOMONTH ( MAX ( 'Table'[Date] ), -1 ),
        -3,
        MONTH
    )
) / 3

vkkfmsft_0-1657609422937.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much!  That works like a charm!!

amitchandak
Super User
Super User

@JaclynPugh2022 , Try a measure like example

 

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-3,MONTH))

Thank you for the suggestion.  That does result in the current month total (at top of list below) to appear in the overall grand total field (at the bottom); however, I need it to roll forward 3 months as a forecast.  Any suggestions?   Thank you  

 

JaclynPugh2022_0-1657222135108.png

 

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.