Forum Discussion

databi_nerd's avatar
databi_nerd
Frequent Visitor
2 years ago

Shortages calculation

Hi PBI Community Members,

I need help building measure logic to calculate shortages and below is the logic and scenario.

Core tables
---> Products (Dim)
---> Order (Fact)

---> Stocks (Fact)
---> BOM (Dim)

  • First of all, I have one Dimension which is Products containing unique columns (in single column ) for finished and semi-finished products.
  • Then I have orders where I have an Order for finished products. Orders have * to 1 relationship with Products.
  • I have one more table for Stocks where we have stocks for all Products including finished and semi-finished products. Stocks have * to 1 relationship with Products.
  • Then I created one measure to calculate Required Production based on [Orders] - [Stocks]
  • I have another table where I have Bill of Material (BOM) information, have one column for Finished Product and second column for it's components (semi finished product) like for Finished Product = A1 ---> Semi Finished Product = B1, B2, B3 in short in order to produce A1 I need those 3 component and for that I need to calculate the Stocks first and then each component needs. Products 1 to * BOM (Inactive relationship) & Products 1 to * BOM (Inactive relationship)

Please feel free to ask me if mor einformation required.

Thanks in advance!

2 Replies