- Develop a dynamic Sales by Month query to be used by the forecast variables. The query must use the current year history if it's available or, if the month isn't completed in the current year, use the prior year value.
- To simplify this query, create a PriorYearMonthlySales query and a CurrentYearMonthlySalesQuery:
The following expression of the PriorYearMonthlySales query only retrieves the prior year months that haven't been completed in the current year:
let CurrentYear = Date.Year(DateTime.Date(DateTime.LocalNow())),CurrentMonth ...