Forum Discussion
Inventory forecasting
- 5 years ago
Hi jakeudy ,
Try to create a Date dimension table and create relationships between your 'Forecast Table' and the Date table. Then, change your measure like below and replace the date column from 'Forecast Table' with the date column from Date table in your visualizations.
Stock = VAR _CHANGE = SUMX ( FILTER ( ALL ( 'Forecast Table' ), 'Forecast Table'[Date] <= MAX ( 'Date'[Date] ) ----------------------------changed && 'Forecast Table'[Material] = MAX ( 'Forecast Table'[Material] ) && 'Forecast Table'[Site] = MAX ( 'Forecast Table'[Site] ) ), 'Forecast Table'[Quantity] ) VAR _Total = SUMX ( FILTER ( 'On Hand Table', 'On Hand Table'[Material] = MAX ( 'Forecast Table'[Material] ) && 'On Hand Table'[INVENTORYSITEID] = MAX ( 'Forecast Table'[Site] ) ), 'On Hand Table'[Physical Inventory] ) RETURN _CHANGE + _TotalIf this method doesn't work, please share me some sample data, not real data, for test.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
Hi jakeudy ,
Try to create a Date dimension table and create relationships between your 'Forecast Table' and the Date table. Then, change your measure like below and replace the date column from 'Forecast Table' with the date column from Date table in your visualizations.
Stock =
VAR _CHANGE =
SUMX (
FILTER (
ALL ( 'Forecast Table' ),
'Forecast Table'[Date] <= MAX ( 'Date'[Date] ) ----------------------------changed
&& 'Forecast Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'Forecast Table'[Site] = MAX ( 'Forecast Table'[Site] )
),
'Forecast Table'[Quantity]
)
VAR _Total =
SUMX (
FILTER (
'On Hand Table',
'On Hand Table'[Material] = MAX ( 'Forecast Table'[Material] )
&& 'On Hand Table'[INVENTORYSITEID] = MAX ( 'Forecast Table'[Site] )
),
'On Hand Table'[Physical Inventory]
)
RETURN
_CHANGE + _Total
If this method doesn't work, please share me some sample data, not real data, for test.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.