Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Rolling Subtraction from Fixed Inventory Value

I'm attempting to get the remaining inventory function to return the total inventory from the previous month minus the forecasted sales from the previous month. October and November are correct, however December should be 168 (175 - 7). The measure I'm currently using is as follows - pMonth Sales is just a quick measure to return the previous month's sales:

Remaining Inventory = 
if([Total Inventory] > 0 , [Total Inventory], 
CALCULATE(
    if([Total Inventory] > 0 , [Total Inventory], 
   CALCULATE([Total Inventory]
   ,PARALLELPERIOD(FiscalDateTable[Date],-1,MONTH)) - [pMonth Sales])
   ,PARALLELPERIOD(FiscalDateTable[Date],-1,MONTH)) - [pMonth Sales])

2 Replies