Forum Discussion
Anonymous
6 years agoNot applicable
Stock usage over time
Hi everyone, I am trying to calculate stock usage per day to make ordering easier. I have several tables: 1. Ingredients 2. Menu Items 3. Date Table 4. Recipes Table ...
- 6 years ago
Hi Anonymous ,
Maybe you can try this:
1. Do not create relationships using 'Menu Table', and create 'Many-to-Many' relationship between 'Recipes Table' and 'Menu Item Sales Table' instead.
2. Create a measure.
Ingredient Sales = SUMX ( ItemSales, CALCULATE ( MAX ( ItemSales[Qty Sold] ), ALLEXCEPT ( 'Granular Recipes', 'Granular Recipes'[Item Name], 'Granular Recipes'[Ingredient] ) ) * CALCULATE ( MAX ( 'Granular Recipes'[Quantity] ), ALLEXCEPT ( ItemSales, ItemSales[Date], ItemSales[Item Name] ) ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
6 years agoCommunity Support
Hi Anonymous ,
Can you give me some samples of each tables? So that I can create a complete data model.
Best Regards,
Icey