Forum Discussion
Forecasting current month based on data so far
- 9 years ago
Hi
I modified your sample data a bit as follows:
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:
Hope this helpsJJ
Hi
I modified your sample data a bit as follows:
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:
Hope this helps
JJ
- mahawkins39 years agoHelper I
Worked a treat. Much appreciated. Knew there must be a way, but I'm completely new to DAX!
- Anonymous3 years agoNot applicable
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.
- Carolyn_8163 years agoRegular Visitor
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