Report on stock snapshots
Stock adds up across stores and not across time. Set the model up to know that.
The sample’s inventory_snapshots table has one row per product and store every Sunday. Adding a year of them counts the same boxes 52 times.
In the model
When you draft the model, On hand qty is proposed as semi-additive over the snapshot date and marked to check. Accept it. For your own tables, set a measure’s additivity to semi-additive and choose the date.
- On hand qty: semi-additive. Return rate and Margin %: non-additive.
What you get
| Block has | You see |
|---|---|
| Category | Stock at the latest snapshot for each category |
| Category and month | Stock at the last snapshot in each month |
| Category and snapshot date | Stock at every snapshot |
| A filter on last quarter | Stock at the last snapshot in that quarter |
Watch for
The latest date is found per group. If one store stops sending snapshots, its stock is the last it sent, and a table by store hides that. Add Snapshot date (Maximum) as a column to see how fresh each row is.
A group whose dates are all empty shows no stock.
Average stock
For average stock over a period, make the measure an average in the block and include the snapshot date, or the average is over the latest date alone.

