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

Forecasting current month based on data so far

Hi,

 

I'm looking to create a report that shows monthly totals for the last x months, then for the current month, I'd want it to be able to show a forecast of where the month will get to based on the numbers so far this month.

 

I have played around with the in-built forecasting tool, but that doesn't quite seem to do what I want. All that allows me to do is forecast the current (and following) months based on the numbers in previous months; it doesn't factor this month's numbers so far into the calculation.

 

So let's say it's April 16th, and we have data from Jan 1st up to yesterday:

January: 1,000,000

Feb: 2,000,000

March: 3,000,000

April (up to the 15th): 2,200,000

 

The way the forecasting tool works, if I tell it to ignore the last 1 month, it will give me a projection of 4,000,000 for April based on the growth from Jan-March. What I actually want it to do is forecast April based on that 2,200,000 so far. Using the simplest possible forecasting method, this would come out as 4,400,000.

 

Is there some way of doing this?

 

Thanks in advance,

Matt

1 ACCEPTED SOLUTION
DoubleJ
Solution Supplier
Solution Supplier

Hi

 

I modified your sample data a bit as follows:

Forecast_01.PNG
I created a measure called "ForecastMonthly"  that calculates the forecast (you might have to replace the semicolons with commas):

 

ForecastMonthly = 
CALCULATE(
DIVIDE(
SUM(Revenue[Revenue]);
DAY(MAX(Revenue[Date])) /*Last day with sales*/
)
* Day(EOMONTH(MAX(Revenue[Date]);0)); /*Days in Month*/
FILTER(Revenue;EOMONTH(Revenue[Date];0)=EOMONTH(TODAY();0) /*Calculate the forecast only for the current month*/
))
+
CALCULATE(SUM(Revenue[Revenue]);
FILTER(Revenue;EOMONTH(Revenue[Date];0) < EOMONTH(TODAY();0))) /*Calculate the revenue for the past months*/

 

 

Explanation:
The first part calculates the forecast for the current month by summing up the revenues. Then dividing the summed up revenues by the number of days for the last sale and then multiplying it with the total days of the month.
The second part simply sums up the revenues for all past months.

The result:


Forecast_02.PNG

Hope this helps

JJ

View solution in original post

4 REPLIES 4
DoubleJ
Solution Supplier
Solution Supplier

Hi

 

I modified your sample data a bit as follows:

Forecast_01.PNG
I created a measure called "ForecastMonthly"  that calculates the forecast (you might have to replace the semicolons with commas):

 

ForecastMonthly = 
CALCULATE(
DIVIDE(
SUM(Revenue[Revenue]);
DAY(MAX(Revenue[Date])) /*Last day with sales*/
)
* Day(EOMONTH(MAX(Revenue[Date]);0)); /*Days in Month*/
FILTER(Revenue;EOMONTH(Revenue[Date];0)=EOMONTH(TODAY();0) /*Calculate the forecast only for the current month*/
))
+
CALCULATE(SUM(Revenue[Revenue]);
FILTER(Revenue;EOMONTH(Revenue[Date];0) < EOMONTH(TODAY();0))) /*Calculate the revenue for the past months*/

 

 

Explanation:
The first part calculates the forecast for the current month by summing up the revenues. Then dividing the summed up revenues by the number of days for the last sale and then multiplying it with the total days of the month.
The second part simply sums up the revenues for all past months.

The result:


Forecast_02.PNG

Hope this helps

JJ

This was very helpful, how would I go about forcasting out the rest of the year? I've tried so many things and I can't seem to get it to work. TIA

This works well for forecasting current month. How can we expand this to forecast the current year using current months data. Lets say we have three months of cost data, how do we use that to forecast the current FY year.

Worked a treat. Much appreciated. Knew there must be a way, but I'm completely new to DAX!

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.