Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Bindi_Baji
Frequent Visitor

Calculating Component Usage

Good morning,
Sorry if this has been covered before. I am attempting to calculate component usage from a BOM  / Bill of Materials and I'm unsure how to set this up in PBI, realtionship wise etc.
I've looked for other posts but they seem to link to an article that no longer exists in most case. 
My data is as below:


Data table for finished products:

Unique_CodeProduction_CodeBOM_No
1900160009678PBTEST001
1900229098576PBTEST002

 

Data table for BOMs

BOM_NoComponent_NoComponent_Qty
PBTEST001289920.018
PBTEST001300660.025
PBTEST001300631
PBTEST001285031
PBTEST002236680.0132
PBTEST002295290.2025
PBTEST002283971
PBTEST002288660.002

 

Fact table for production:

Production_DateProduction_CodePacks
22/05/2024 00:0029098576692
22/05/2024 00:0060009678328
24/05/2024 00:0029098576428
24/05/2024 00:0060009678628
26/05/2024 00:0029098576368
26/05/2024 00:0060009678464
28/05/2024 00:0029098576540
28/05/2024 00:0060009678396
29/05/2024 00:0029098576468
29/05/2024 00:0060009678708
31/05/2024 00:0029098576280
31/05/2024 00:0060009678268
02/06/2024 00:0029098576480
02/06/2024 00:0060009678784
04/06/2024 00:0029098576532
04/06/2024 00:0060009678848
06/06/2024 00:0029098576616
06/06/2024 00:0060009678188
08/06/2024 00:0029098576448
08/06/2024 00:0060009678128
09/06/2024 00:0029098576288
09/06/2024 00:0060009678332
11/06/2024 00:0029098576576
11/06/2024 00:0060009678180
13/06/2024 00:0029098576608
13/06/2024 00:0060009678724
14/06/2024 00:0029098576412
14/06/2024 00:0060009678492
16/06/2024 00:0029098576296
16/06/2024 00:0060009678708
17/06/2024 00:0029098576324
17/06/2024 00:0060009678680
19/06/2024 00:0029098576612
19/06/2024 00:0060009678600
21/06/2024 00:0029098576440
21/06/2024 00:0060009678444
23/06/2024 00:0029098576424
23/06/2024 00:0060009678684
25/06/2024 00:0029098576664
25/06/2024 00:0060009678844
27/06/2024 00:0029098576464
27/06/2024 00:0060009678624
29/06/2024 00:0029098576516
29/06/2024 00:0060009678312
01/07/2024 00:0029098576492
01/07/2024 00:0060009678388
02/07/2024 00:0029098576212
02/07/2024 00:0060009678780

 

Any help would be gratefully received!

3 REPLIES 3
Bindi_Baji
Frequent Visitor

Hi,
Apologies for bump.
Anyone able to offer any assistance please?

v-huijiey-msft
Community Support
Community Support

Hi @Bindi_Baji ,

 

Please try:

 

Create relationships for the three tables you provided:

 

Use "BOM_No" to connect "BOMs" to "products", and then use "Production_Code" to connect "products" to "production".

 

After creating the relationship, it should look like this:

vhuijieymsft_0-1720056487328.png

 

Create a calculated column:

Component_Usage = 
SUMX(
    RELATEDTABLE('BOMs'),
    'BOMs'[Component_Qty] * 'production'[Packs]
)

 

This formula iterates through each component of each production code, multiplying the component quantity in the BOM by the pack quantity in the production table, and then summing the results.

 

The visual effect of the page should look like this:

vhuijieymsft_1-1720056487344.png

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Hi,
Unoftunately, not what I'm looking for.
Apologies, probably my fault for not being more specific.
Would be something like the below output (or similar)
 

Bindi_Baji_1-1720596501691.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.