Forum Discussion
forecast + actual data
Hi All,
I have calculated a forecast based on historic data for the last 6 years using the below and dividing it by total years. This works fine
I now want to combine this with the actuals so the forecast data only begins where the actuals end and I am having problems with the following DAX
VAR LastopenedDate = CALCULATE( MAX('Sales Attributes'[date store opened].[Date]), REMOVEFILTERS())
PJHos , do not use .date. Mark you calendar table as date table, that option will go away
Forecasting - Cumulative Forecast =
VAR StoressOpenedLY = CALCULATE(
[Total No Of Storess], DATEADD('Stores Attributes Calender'[Date], -1, YEAR) )and
VAR ForecastTotal = CALCULATE([Forecasting - Cumulative Forecast], KEEPFILTERS( 'Store Attributes Calender'[Date]> [Forecasting - Last Store Opening Date]))
also can explain need of KEEPFILTERS( 'Store Attributes Calender'[Date]> [Forecasting - Last Store Opening Date])
2 Replies
- amitchandakSuper User
PJHos , do not use .date. Mark you calendar table as date table, that option will go away
Forecasting - Cumulative Forecast =
VAR StoressOpenedLY = CALCULATE(
[Total No Of Storess], DATEADD('Stores Attributes Calender'[Date], -1, YEAR) )and
VAR ForecastTotal = CALCULATE([Forecasting - Cumulative Forecast], KEEPFILTERS( 'Store Attributes Calender'[Date]> [Forecasting - Last Store Opening Date]))
also can explain need of KEEPFILTERS( 'Store Attributes Calender'[Date]> [Forecasting - Last Store Opening Date])
- PJHosAdvocate I
Hi Amit
Thank you very much!! It worked
also can explain need of KEEPFILTERS( 'Store Attributes Calender'[Date]> [Forecasting - Last Store Opening Date])
This was so i can have actuals and forecast totals in 1 column
Thank you again, marked as answered😀