Forum Discussion
Forecasting Sales
- 2 years ago
Hi LC01 - To forecasting sales based on the average of the past 2 weeks for each item until their specific end date and displaying.
Create a measure to calculate the Average Daily Sales for the Past 2 Weeks
AvgDailySales =
CALCULATE(
AVERAGE('Sales'[SalesAmount]),
DATESINPERIOD(
'Dim Date'[Date],
MAX('Dim Date'[Date]),
-14,
DAY
)
)create another measure to calculate end date from each day:
DaysFromEnd =
DATEDIFF(
TODAY(),
MAX('Sales'[EndDate]),
DAY
)we can use the above calculation for forcasting
TotalForecastedSales =
SUMX(
SUMMARIZE(
'Sales',
'Sales'[Item],
"ItemForecast", [AvgDailySales] * [DaysFromEnd]
),
[ItemForecast]
)Hope it works, check it
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Hi LC01 - To forecasting sales based on the average of the past 2 weeks for each item until their specific end date and displaying.
Create a measure to calculate the Average Daily Sales for the Past 2 Weeks
AvgDailySales =
CALCULATE(
AVERAGE('Sales'[SalesAmount]),
DATESINPERIOD(
'Dim Date'[Date],
MAX('Dim Date'[Date]),
-14,
DAY
)
)
create another measure to calculate end date from each day:
DaysFromEnd =
DATEDIFF(
TODAY(),
MAX('Sales'[EndDate]),
DAY
)
we can use the above calculation for forcasting
TotalForecastedSales =
SUMX(
SUMMARIZE(
'Sales',
'Sales'[Item],
"ItemForecast", [AvgDailySales] * [DaysFromEnd]
),
[ItemForecast]
)
Hope it works, check it
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Thanks after changing it a bit it worked. For example the average wasnt working properly, so I changed for sum & divide by number of days.