Basic inventory calculations
Let us start by answering the most basic question: what is the actual inventory? Because of the way we have modeled our data, this one is easy to do:
Actual Inventory =
CALCULATE(
SUM(fInventory[Quantity]),
fInventory[Type] = 0
)
All we need to do is retrieve the rows with [Type] = 0
, as it is in those where the actual inventory is stored.
There is one issue with this calculation, however: it assumes that we have selected the whole of the Calendar
table, or at least made a selection that includes the date with the Type
0 rows. After all, when we select last year, the rows containing the current inventory will not be selected. It would be better to create a measure that returns a result for any selection on Calendar
.
If we assume that we have some selection in Calendar
, the first question to ask is: which exact date do we pick to return the status for? After all, the inventory status is strictly date-specific.
The common practice...