Beginning & Closing Inventory Balance

Hi Guys!

I`m trying to obtain the Beginning & Closing Inventory Balance, I was able to get these results when I used the entire time the business has been in business (Sep 2019 - July 2020).

The thing is that when I filter by Date I don`t a result for Beginning Inventory Units and get different results for Ending Inventory Units

These are the formulas that I`m using for the Inventory:

I need to be able to see the inventory by date because later on, I`ll use these measures for the Income Statement data base.

Something like this but without the Month & Year.

I attached the PBIX file for reference.

Thanks for the help!


Example Data.pbix (391.4 KB)

This is because of the context your date function is linked. Its linked with purchase date. So the context of your calculation is purchase date. You can use virtual date function. I believe this video from SAM will help you.


Hi @piryani,

The video you send me is only about the functions though.

Can you explain to me how I´ll use a virtual date function for this problem?

I have a Table just for the date and I believe I`m not using the purchase date for the filter date.

Thanks for the help.


Hi @Yeriel,

The video will help you understand the date function can help with calculating the opening and closing balance thorough dax formula. Your date table has a relation with your purchase table.

That is why @piryani sent you that information.


Hi @piryani, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!