It is possible. I have this functionality in my app
itemstore.glideapp.io
Just have to set the initial amount. Then, do a relation to the item name in your sales sheet. Roll up the count and use a math column to subtract the count from the original total.