Forum Discussion
chad_clift
Helper I
4 years agoForecasting beginning month inventory based on usage forecast
I'm trying to create a measure that rolls the beginning of month inventory forecast based on the prior month's forecast. The next month forecast is previous month stock (either actual or forecast) m...
- 4 years ago
Hi chad_clift ,
According to your description, it's related to your measure formula. I create a sample and here's my solution.
Create a measure.
BOM Forecast = VAR _Lastnonblank = MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[BOM on hand] <> BLANK () ), 'Table'[Month] ) RETURN IF ( MAX ( 'Table'[BOM on hand] ) <> BLANK (), MAX ( 'Table'[BOM on hand] ), MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Month] = _Lastnonblank ), 'Table'[BOM on hand] ) - SUMX ( FILTER ( ALL ( 'Table' ), 'Table'[Month] >= _Lastnonblank && 'Table'[Month] <= MAX ( 'Table'[Month] ) ), 'Table'[Usage Actual/Forecast] ) )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yanjiang-msft
Community Support
4 years agoHi chad_clift ,
According to your description, it's related to your measure formula. I create a sample and here's my solution.
Create a measure.
BOM Forecast =
VAR _Lastnonblank =
MAXX (
FILTER ( ALL ( 'Table' ), 'Table'[BOM on hand] <> BLANK () ),
'Table'[Month]
)
RETURN
IF (
MAX ( 'Table'[BOM on hand] ) <> BLANK (),
MAX ( 'Table'[BOM on hand] ),
MAXX (
FILTER ( ALL ( 'Table' ), 'Table'[Month] = _Lastnonblank ),
'Table'[BOM on hand]
)
- SUMX (
FILTER (
ALL ( 'Table' ),
'Table'[Month] >= _Lastnonblank
&& 'Table'[Month] <= MAX ( 'Table'[Month] )
),
'Table'[Usage Actual/Forecast]
)
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.