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
kjohn10
Helper I
Helper I

Current month vs Previous month Forecast difference

I've looked through various posts here, and I cannot seem to get any of the DAX or 'Quick Calcs' to work right for calculating the current months forecast value versus that month's forecast value last month. 

Sample data below; Each month a new forecast is released (ForecastDate), and it starts with the current month (ForecastMonths) and goes out 12 months (just showing first 3 months here).

forecast-data.png

Taking SKU 'abc123' for example, for the initial forecast (ForecastDate 2017-01-01) for ForecastMonths 2017-02-01 (next month) units is 20. Then next months forecast, ForecastDate=2017-02-01, for ForecastMonths 2017-02-01, units is 25. The difference is +5 units from last months forecast for this month. Whats the right way to get this calculated...measure? column? I've tried multiple different measure calculations based on various posts, I could not get any to work out.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may refer to my solution here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may refer to my solution here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes, thank you that helped. Looking between what I had tried, and your solution, I noted that I was associating my Date table date to the data ForecastDate, instead of ForecastMonths, which caused my data to not calculate.

 

For those who may not want to download the solution, here is the basics to complete this; using data above and calling it 'Data', and having a generated Date table with range of appropriate dates:

 

Next forecast = CALCULATE(SUM(Data[Units]),FILTER(Data,Data[ForecastDate]=Data[ForecastMonths]))

Previous forecast = if(ISBLANK([Next forecast]),BLANK(),CALCULATE(SUM(Data[Units]),FILTER(Data,EDATE(Data[ForecastMonths],-1)=[ForecastDate])))

Variance = if(ISBLANK([Previous forecast]),BLANK(),[Next forecast]-[Previous forecast])

 

Then just use the Date table Year and Month columns (generated from the main date column), and ensure to associate the Date column to the ForecastMonths.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.