Forum Discussion
BOM explosion inside BOM
- Anonymous3 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Finished Products quantities = var _select=SELECTEDVALUE('SalesOrderTable'[Product]) var _sumquantity=SUMX(FILTER(ALL(SalesOrderTable),'SalesOrderTable'[Product]=_select),[Quantity]) var _p1=MAXX(FILTER(ALL('Product Category'),'Product Category'[Product]=_select),[Category]) var _column=SELECTCOLUMNS(FILTER(ALL('Product Category'),'Product Category'[Category]=_p1),"1",[Product]) return IF( MAX('BillsOfMaterialTable'[FinishedProduct]) in _column&&MAX('BillsOfMaterialTable'[FinishedProduct])=_select,_sumquantity *MAX('BillsOfMaterialTable'[Percentage%]),0)Raw Materials = var _select=SELECTEDVALUE('SalesOrderTable'[Product]) var _sumquantity=SUMX(FILTER(ALL(SalesOrderTable),'SalesOrderTable'[Product]=_select),[Quantity]) var _p1=MAXX(FILTER(ALL('Product Category'),'Product Category'[Product]=_select),[Category]) var _column=SELECTCOLUMNS(FILTER(ALL('Product Category'),'Product Category'[Category]=_p1),"1",[Product]) return IF( NOT(MAX('BillsOfMaterialTable'[RawMaterial]))in _column&&MAX('BillsOfMaterialTable'[FinishedProduct])=_select,_sumquantity *MAX('BillsOfMaterialTable'[Percentage%]),0)2. Result:
If the results do not meet your expectations, can you show the expected results in the form of pictures, how to obtain Finished Products quantities and Raw Materials, we can better help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Finished Products quantities =
var _select=SELECTEDVALUE('SalesOrderTable'[Product])
var _sumquantity=SUMX(FILTER(ALL(SalesOrderTable),'SalesOrderTable'[Product]=_select),[Quantity])
var _p1=MAXX(FILTER(ALL('Product Category'),'Product Category'[Product]=_select),[Category])
var _column=SELECTCOLUMNS(FILTER(ALL('Product Category'),'Product Category'[Category]=_p1),"1",[Product])
return
IF(
MAX('BillsOfMaterialTable'[FinishedProduct]) in _column&&MAX('BillsOfMaterialTable'[FinishedProduct])=_select,_sumquantity *MAX('BillsOfMaterialTable'[Percentage%]),0)Raw Materials =
var _select=SELECTEDVALUE('SalesOrderTable'[Product])
var _sumquantity=SUMX(FILTER(ALL(SalesOrderTable),'SalesOrderTable'[Product]=_select),[Quantity])
var _p1=MAXX(FILTER(ALL('Product Category'),'Product Category'[Product]=_select),[Category])
var _column=SELECTCOLUMNS(FILTER(ALL('Product Category'),'Product Category'[Category]=_p1),"1",[Product])
return
IF(
NOT(MAX('BillsOfMaterialTable'[RawMaterial]))in _column&&MAX('BillsOfMaterialTable'[FinishedProduct])=_select,_sumquantity *MAX('BillsOfMaterialTable'[Percentage%]),0)
2. Result:
If the results do not meet your expectations, can you show the expected results in the form of pictures, how to obtain Finished Products quantities and Raw Materials, we can better help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly