The Inventory table holds a snapshot of units on hand per product at each month end. Stock adds up across products (two products with 10 units each make 20), but not across time: January's 20 units and February's 20 units aren't 40. That makes stock a semi-additive measure.
For a period, report the snapshot at its end:
Closing Stock = CALCULATE(SUM(Inventory[Units On Hand]), LASTDATE('Date'[Date]))
In a month row, LASTDATE is the month end, where the snapshot is. In a year row it's December 31.
The edge case: December 2025 hasn't been counted yet, so the 2025 closing stock is blank. LASTNONBLANK finds the last date that has data instead:
CALCULATE(SUM(...), LASTNONBLANK('Date'[Date], CALCULATE(SUM(Inventory[Units On Hand]))))