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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ARYAL_Gunjan369
Frequent Visitor

Help with Multi-Level BOM Explosion for Daily Production Plan Distribution in Power BI

Hello Community,

I’m currently working on a dashboard in Power BI to manage and visualize the distribution of a daily production plan in a repetitive manufacturing setup. I’m facing challenges with handling a multi-level Bill of Materials (BOM) structure, particularly in distributing the production quantities from parent items down to their respective children and sub-children.

For example, I have:

  • 2 Parent items (e.g., Parent A = 5000 PCS, Parent B = 3000 PCS)
  • 5 Child items
  • 10 Sub-child (enfant) items

I only have the production plan at the parent level, and I need to explode the BOM to calculate and distribute the required quantities to each child and sub-child based on their usage in the hierarchy.

Has anyone implemented a similar solution in Power BI? I’d appreciate any guidance, DAX patterns, or data modeling tips to achieve this.

Thanks in advance

1 ACCEPTED SOLUTION

I based the solution on the sample data. It is difficult to come up with a solution when the sample data is not a complete representation of the actual. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

9 REPLIES 9
v-pgoloju
Community Support
Community Support

Hi @ARYAL_Gunjan369,

 

kindly requesting you to share sample data in a workable format such as a text file, Excel file, or PBIX file.

Additionally, please include clear and detailed requirements on additional requirements, along with the expected output, so we can better understand the scenario and assist you more effectively.

 

Regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @ARYAL_Gunjan369,

 

 we kindly request you to share sample data in a workable format such as a text file, Excel file, or PBIX file.

Additionally, please include clear and detailed requirements on additional requirements, along with the expected output, so we can better understand the scenario and assist you more effectively.

v-pgoloju
Community Support
Community Support

Hi @ARYAL_Gunjan369,

 

If the issue still persists, we kindly request you to share sample data in a workable format such as a text file, Excel file, or PBIX file  rather than screenshots.

Additionally, please include clear and detailed requirements, along with the expected output, so we can better understand the scenario and assist you more effectively.

 

Thanks & Regards,

Prasanna Kumar

ARYAL_Gunjan369
Frequent Visitor

Sorry to say that this solution didnot worked for me in my case. As it is not related only to one hierarchy as i told in my query that the partents and child must match the profit center and mrp controller. Thanks.

I based the solution on the sample data. It is difficult to come up with a solution when the sample data is not a complete representation of the actual. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
v-pgoloju
Community Support
Community Support

Hi @ARYAL_Gunjan369,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @danextian  for prompt and helpful responses.

Just following up to see if the solution provided by community member were helpful in addressing the issue.

If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

ARYAL_Gunjan369
Frequent Visitor

Thanks for the response. Due to data security policies, I can’t share the actual PBIX or Excel files, but here’s a simplified and relatable example:


Sample Data Structure

BOM Table (Parent-Child Relationships):

Parent Item Child Item Quantity per Parent
Parent AChild 12
Parent AChild 23
Child 1Enfant 11
Child 1Enfant 22
Child 2Enfant 31
Parent BChild 31
Parent BChild 42
Child 4Enfant 43
Child 4Enfant 51
 

Production Plan Table:

Parent Item Planned Quantity
Parent A5000
Parent B3000
 

Expected Output

I want to calculate the required quantities for each child and sub-child based on the parent production plan and the BOM structure. For example:

  • Parent A = 5000 PCS

    • Child 1 = 5000 × 2 = 10,000
      • Enfant 1 = 10,000 × 1 = 10,000
      • Enfant 2 = 10,000 × 2 = 20,000
    • Child 2 = 5000 × 3 = 15,000
      • Enfant 3 = 15,000 × 1 = 15,000
  • Parent B = 3000 PCS

    • Child 3 = 3000 × 1 = 3000
    • Child 4 = 3000 × 2 = 6000
      • Enfant 4 = 6000 × 3 = 18,000
      • Enfant 5 = 6000 × 1 = 6000

Additional Requirements

  • The Parent, Child, and Enfant items are produced in different profit centers and may be managed by different MRP controllers.
  • I need to implement dynamic slicers in the dashboard to filter by:
    • Profit Center
    • MRP Controller
    • Material Hierarchy (Parent → Child → Enfant)
  • The goal is to visualize the distributed production plan across all levels, filtered by organizational structure and material hierarchy.

Hi @ARYAL_Gunjan369 

To facililate the calculation, transform the Parent-Child table into a  format where there is a separate column for the Parent, Child and Infant. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkgsSs0rUXBU0lFyzsjMSVEwBLKMlGJ1sEgZAVnGYCmEUte8tESgIhDTELuUEdxAhClQKWO4LqhdTnC78EiZoBlogjDQBM2FSFKmEANjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Parent Item" = _t, #"Child Item" = _t, #"Quantity per Parent" = _t]),
    // Get list of parent and child columns
    ParentList = List.Distinct(Source[Parent Item]),
    ChildList = List.Distinct(Source[Child Item]),

    // Leaf nodes = children that never appear as parents
    LeafNodes = List.Difference(ChildList, ParentList),

    // Filter only leaf node rows
    LeafsOnly = Table.SelectRows(Source, each List.Contains(LeafNodes, [Child Item])),

    // Define recursive function to trace lineage upward
    RecurseFn = 
        let
            f = (child as text) as list =>
                let
                    parentRow = Table.SelectRows(Source, each [Child Item] = child),
                    parent = if Table.IsEmpty(parentRow) then null else parentRow{0}[Parent Item]
                in
                    if parent = null then {child}
                    else List.Combine({@f(parent), {child}})
        in f,

    // Add full lineage path for each leaf
    WithPath = Table.AddColumn(LeafsOnly, "Path", each RecurseFn([Child Item])),

    // Split the path into Parent, Child, Enfant
    WithHierarchy = Table.AddColumn(WithPath, "Hierarchy", each [
        Parent = try [Path]{0} otherwise null,
        Child = try [Path]{1} otherwise null,
        Enfant = ( try [Path]{2} otherwise null ) ?? Child
    ]),
    #"Expanded Hierarchy" = Table.ExpandRecordColumn(WithHierarchy, "Hierarchy", {"Parent", "Child", "Enfant"}, {"Parent", "Child", "Enfant"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded Hierarchy",{"Parent", "Child", "Enfant", "Quantity per Parent"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"Quantity per Parent", "Enfant Qty"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Child Qty", each let 
child = [Child],
row = List.PositionOf(Source[Child Item], child)
in 
Source[Quantity per Parent]{row}),
    #"Reordered Columns" = Table.ReorderColumns(#"Added Custom",{"Parent", "Child", "Child Qty", "Enfant", "Enfant Qty"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Reordered Columns",{{"Parent", type text}, {"Child", type text}, {"Child Qty", Int64.Type}, {"Enfant", type text}, {"Enfant Qty", Int64.Type}})
in
    #"Changed Type"

Note: custom function above was created with the help of AI with minor editing.

 

danextian_2-1753352321313.png

 

Once loaded, create a one to many single direction relationship from the planned quantity table to parent child hierarchy.

danextian_3-1753352374718.png

Create this calculated column

Planned Qty = 
VAR _PlannedQtyByParent =
    RELATED ( PlannedQuantity[Planned Quantity] )
RETURN
    ParentChildHierarchy[Child Qty] * ParentChildHierarchy[Enfant Qty] * _PlannedQtyByParent

danextian_4-1753352413400.png

danextian_5-1753352461437.png

 

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @ARYAL_Gunjan369 

Please start by  providing a workable sample data (not an image), your expected result from the same sample data and your reasoning behind -

how do you intend to explode/breakdown the parent total into into its sub-children?

weighted percentage? Equally?

You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.