Forum Discussion
Need DAX help with Inventory on Hand
OK I'm less clear on what you are asking!
The last measure I gave you would calculate the inventory on hand for any given date you choose. But from your table I'm thinking what you are actually asking for is a measure that would calculate the inventory you had on hand, for every date in your data? Is that right?
Yes that is correct. Assume a fact table with thousands of rows with an EquipmentID, a date it was created (i.e. CreateDate), a StatusDate for when the status changes, and a status description (i.e. Active, Removed). So if we pick a date of June 1, 2019 and look in the fact table we should see several rows for different Equipment IDs with a CreateDate of Jun 1, 2019 meaning they were placed into inventory on that date. But what about the thousands of Equipment IDs that were placed into Inventory on earlier days. They are still in Inventory. For example, a piece of equipment with a CreateDate of Mar 14, 2018 with no status change is still in inventory on Jun 1, 2019. I would like to count ALL of the pieces of equipment in inventory for each day. Hopefully this makes sense.