Forum Discussion
Inventory turnover from transaction data
Hello all,
I've spent a couple of days trying to build a model for calculating inventory turnover for any selected product(s) on any selected timescale (year/quarter/month). I'd also like to be able to plot the turnover by year/quarter/month to see if there's any visible trend. The inventory turnover is supposed to be calculated as "Value of used products" divided by the "Average inventory value". The "Average inventory value" should be based on inventory values at the end of each day.
I have three dimension tables: Product, Stock, Date.
I have one fact table containing the transaction data. It looks something like this:
Let's say I'd like to know the inventory turnover for product AAA-X in stock A01 in August 2018 (and let's say there's no more transaction rows than is showing in the picture). The value of inventory for 1.8.2018 is 20 * 149 € = 2980 € and for 2.8-31.8.2018 the value for each day is 5 * 149 € = 745 €. So the average value of inventory for August is (1 * 2980 € + 30 * 745 €) / 31 = 817.10 €. The value of used products is 15 * 149 € = 2235 €, so inventory turnover is 2235 € / 817.10 € = 2.74.
Now, I am able to to implement this in Power BI, but I have issues with performance. There are currently 46k rows in Product table, 144 rows in Stock table, 3287 rows in Datetable (because the data starts from 2010), and 264k rows in Transaction Table. This doesn't sound like too much data, but the problems start arising if I try to calculate the value of inventory for each product for each day. The reason is that there's no transactions for every product each day, so the calculation always has to look for latest inventory value from the past - which requires a lot of resources when doing this for a large number of products for a long time period.
I'm open to any suggestions on how I could try to do this so that the report doesn't crash due to lack of memory. Measures/calculated tables/query tricks, anything goes. Keep in mind that I need to be able to calculate the inventory turnover for whole inventory in a year/quarter/month as well as one stock or one product at a time.
Thanks in advance.
1 Reply
- v-chuncz-msftCommunity Support