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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
willtunechi
Frequent Visitor

Return all components in a bom structure

I'm trying to create a table in BI where I search for a specific item and it returns all the components of that item and the components of the components (which can be several items), below is an example of the table and what I need. Thank you

Itemcomponent
123777
123987
123546
123444
234987
234481
234678
234111
345333
345222
777321
777600
444450
444451
444452

 

result finding item 123

Itemcomponent
123777
123987
123546
123444
123321
123600
123450
123451
123452
3 REPLIES 3
barritown
Super User
Super User

Hi @willtunechi,

If you have only one level in your hierarchy and need to perform this operation only for "123", you can create a new table like this:

barritown_0-1698407715221.png

In plain text:

New Table = 
VAR _tbl = UNION ( SELECTCOLUMNS ( FILTER ( Data, [Item] = 123 ), "Component", [Component] ), 
                   { 123 } )
RETURN CROSSJOIN ( SELECTCOLUMNS ( { 123 }, "Item", [Value] ), 
                   SELECTCOLUMNS ( FILTER ( Data, [Item] IN _tbl ), "Component", [Component] ) )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Thanks for the answer, there will be more than 10 levels

Missed that point, sorry. 

I'd use PATH then, but it doesn't accept multiple parents as in your case.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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