Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi, I have a specific problem I don't know how to solve. This is what I want to achieve.
My 1st table contains a list of materials with their components, without any information about the depth of the component:
| Material | Component |
| A | B |
| A | C |
| A | D |
| A | E |
| A | F |
| A | G |
| H | I |
| H | J |
| H | K |
| H | C |
| H | L |
My 2nd table contains the same data but formated differently, each row only contains an item, and the list of depth-1 level:
| Item | Sub-titem |
| A | B |
| A | C |
| A | D |
| B | E |
| B | F |
| D | G |
| H | I |
| H | J |
| J | K |
| J | C |
| K | L |
To understand my sample data, keep in mind that I have here only 2 root materials, A and H.
In my report, I have a slicer to select an item from 'Material' column from the 1st table. Then I would like to have the 2nd table filtered to contain only relevant items and sub-items. For example, if I select A in the 1st table, I would like to have the 2nd looking like this:
| Item | Sub-titem |
| A | B |
| A | C |
| A | D |
| B | E |
| B | F |
| D | G |
I need this for a custom visual, showing the bill of materials as a flow, from root level to deeper level.
I gave a look at CALCULATETABLE function, but I actually don't know how to parametrize it. I would be very, very grateful if someone has an idea on how to achieve this.
Solved! Go to Solution.
@_AlexandreRM_ Maybe the code below. Basically a Complex Selector. The Complex Selector - Microsoft Power BI Community
Selector =
VAR __Components = DISTINCT('Table1'[Component])
VAR __Item = MAX('Table2'[Item])
RETURN
IF(__Item IN __Components,1,0)
@Greg_Decklerthank you for your explanation, I now see how I could achieve what I want. But I'm facing a new, probably more common problem.
Here is my links modelisation:
And here is my report page:
1 : 'BOM root materials' is used in the slicer (set to 10005129 in the screenshot).
2 : 'BOM expanded transposed' is showed in a table (equivalent to the Table1 Material/Component).
3 : I calculated the 1st row of your filter formula rows count.
4 : I displayed the Table2 Item/Sub-item with the result of the selector column.
The fact is, I don't see why my slicer filter isn't applied by powerbi in the 'Selector' custom column. I should have seen 8, and not 6324 (whatever I put in the slicer '1' this number doesn't change).
The left table shows the 'BOM expanded transposed' (Table1 Material/Component) content as expected, but the DISTINCT('BOM expanded transposed'[Composant]) calculation isn't filtered by the slicer.
There is probably something I don't understand about slicers interactions between tables and measures.
I finally spotted my error: I was using a calculated column instead of a measure, which don't handle the context the same way. So, problem solved! Thank you @Greg_Deckler !
@_AlexandreRM_ Maybe the code below. Basically a Complex Selector. The Complex Selector - Microsoft Power BI Community
Selector =
VAR __Components = DISTINCT('Table1'[Component])
VAR __Item = MAX('Table2'[Item])
RETURN
IF(__Item IN __Components,1,0)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 37 | |
| 31 | |
| 30 |