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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Create a multi level item list

Hi, i have the following situation?

 

In our company we work with a ''Bill of Material''. This is a list of items you need to create a new item. Als you can see in the screenshot below this is how this table works in my query. The item on the left is the main item and the item on the right are the items that you need to create the item on the left. In many cases the item on the right also has a list of items to make that item. Youcan have this up to maybe like 8 levels in our company. 

 

My question is: How can i create a query that when i select the main item it shows al the different items that are needed to create that and it has checked al the next levels? So basically show all the items that are needed to create the items before them.

Rgieltjes_Meyn_0-1728547698008.png

Please can someone help me. I have already tried merging it with the same table for like 11 times and then creating a pivot table with it, but the load is too heavy then.

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered? If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Kedar_Pande
Super User
Super User

Create a Calculated Table:

AllItems = 
VAR MaxLevels = 8
RETURN
GENERATE(
'YourTable',
VAR CurrentItem = 'YourTable'[Item]
RETURN
SUMMARIZE(
FILTER(
'YourTable',
'YourTable'[Item] = CurrentItem ||
CONTAINS(
SUMMARIZE('YourTable', 'YourTable'[Item]),
'YourTable'[SecondItem],
BLANK()
)
),
'YourTable'[SecondItem]
)
)

Create Measures for Each Level

Level1Items = 
CALCULATE(
DISTINCTCOUNT('YourTable'[SecondItem]),
FILTER('YourTable', 'YourTable'[Item] = "Your Main Item Here") // Replace with the actual main item or use a selected value
)

Level2Items =
CALCULATE(
DISTINCTCOUNT('YourTable'[SecondItem]),
FILTER('YourTable', 'YourTable'[SecondItem] IN VALUES(Level1Items))
)

-- Continue similarly for Level3, Level4, ..., up to Level8

TotalItemsNeeded = 
SUMX(
{ [Level1Items], [Level2Items], [Level3Items], /* Add up to Level8 */ },
[Value]
)

Create a Slicer: Allow users to select the main item.
Use a Table/Matrix Visual: You can display your results using a Matrix visual to show the hierarchy and item dependencies.

 

If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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