Forum Discussion
Whitewater100
Solution Sage
4 years agoDAX Help on Factoring in Lead Time for Forecasting
https://drive.google.com/file/d/1XVKJH_Gzi6ouiAezwefRyFVtw49gtE7k/view?usp=sharing Hello: I am hoping to get some input on revising this forecast measure to account for a SelectedValue for l...
- 4 years ago
I ended up solving this. In case the solution is helpful to others:
Adj '21 FCast QUESTION =VAR LastOrderDate =CALCULATE(MAX( 'ecomm_Sls_FC_Comp'[transaction_date] ),ALL( 'ecomm_Sls_FC_Comp' ))VAR fixedfrozenhorizon = CALCULATE([Total '21 Budget],DATESINPERIOD(Dates[Date],MAX(ecomm_Sls_FC_Comp[transaction_date]),SELECTEDVALUE('Lead Time'[Value]),DAY))VAR LeadTimeDays = SELECTEDVALUE('Lead Time'[Value], 30)VAR AdjustedForecast =SUMX('Dates',IF('Dates'[Date] <= LastOrderDate,[EC Sales Demo],IF('Dates'[Date] > LastOrderDate + LeadTimeDays,[Total '21 Budget] *(1 + [FCast Adj %]),[Total '21 Budget])))RETURNAdjustedForecast
Whitewater100
Solution Sage
4 years agoI ended up solving this. In case the solution is helpful to others:
Adj '21 FCast QUESTION =
VAR LastOrderDate =
CALCULATE(
MAX( 'ecomm_Sls_FC_Comp'[transaction_date] ),
ALL( 'ecomm_Sls_FC_Comp' )
)
VAR fixedfrozenhorizon = CALCULATE(
[Total '21 Budget],
DATESINPERIOD(Dates[Date],
MAX(ecomm_Sls_FC_Comp[transaction_date]),
SELECTEDVALUE('Lead Time'[Value]),DAY))
VAR LeadTimeDays = SELECTEDVALUE('Lead Time'[Value], 30)
VAR AdjustedForecast =
SUMX(
'Dates',
IF(
'Dates'[Date] <= LastOrderDate,
[EC Sales Demo],
IF(
'Dates'[Date] > LastOrderDate + LeadTimeDays,
[Total '21 Budget] *(1 + [FCast Adj %]),
[Total '21 Budget])
)
)
RETURN
AdjustedForecast