Forum Discussion
Foxxon28
Helper I
2 years agoForecast measure with fixed % increase
Dear reader, I have a line chart that has data up untill the current month. Using a YTD / YOY calculation I have a fixed % Change measure. I want to use that [% Change YOY] measure to foreca...
- Anonymous2 years ago
Hi Foxxon28 ,
I create a table and a measure as you mentioned.
% Change YOY = AVERAGE('Table'[Change YOY])Then I create a measure and here is the DAX code.
Measure = VAR MaxMonth = MAX('Table'[Month]) VAR ChangeYOY = [% Change YOY] VAR BaseSales = CALCULATE(SUM('Table'[Change YOY]), 'Table'[Month] = MaxMonth) RETURN SUMX( ADDCOLUMNS( CALENDAR(MaxMonth, DATE(YEAR(MaxMonth), 12, 31)), "ForecastedSales", BaseSales * POWER(1 + ChangeYOY, MONTH([Date]) - MONTH(MaxMonth)) ), [ForecastedSales] )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
Hi Foxxon28 ,
I create a table and a measure as you mentioned.
% Change YOY = AVERAGE('Table'[Change YOY])
Then I create a measure and here is the DAX code.
Measure =
VAR MaxMonth = MAX('Table'[Month])
VAR ChangeYOY = [% Change YOY]
VAR BaseSales = CALCULATE(SUM('Table'[Change YOY]), 'Table'[Month] = MaxMonth)
RETURN
SUMX(
ADDCOLUMNS(
CALENDAR(MaxMonth, DATE(YEAR(MaxMonth), 12, 31)),
"ForecastedSales",
BaseSales * POWER(1 + ChangeYOY, MONTH([Date]) - MONTH(MaxMonth))
),
[ForecastedSales]
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.