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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Comparing BOM of two codes selected from table

Hi new to this, so I have a table of data of all codes with all BOM all materials required. I created two data table with two slicers to select two different codes to compare the materials used. I would like to show what matches and what doesnt match. is this possible based on the slicer filters?

 

example

column 1       column 5

code1            material1

code1             material2

code1            material3

code2           material 1

code2            material 4

code2            material 5

code3            material 5

code3            material 1

code3             material 2

 

so if i select code 1 from table/slicer1 and code 2 from table/slicer2    material matched = material 1 and not match = 2 3 4 5

 

or if i select code 1 from table/slicer1 and code 3 from table/slicer3    material matched - materials 1 2 and not match 3 5

 

is it possible to do this with a measure?

 

thanks

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Create two independent tables for code and use them in the slicer 

 

Try like

 

Measure =
var _1 = calculate(distinctcount(Table[material1]), filter(Table,Table[code] in values(Table1[Code]))
var _2 = calculate(distinctcount(Table[material1]), filter(Table,Table[code] in values(Table2[Code]))
return
if(_1-_2 = 0 || isblank(_1-_2) , 1,blank())

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, Sorry i can't get it to work, are there 3 tables involved? I can't get the code to work as it keeps giving me error message. for this to work do you mind showing how it would work? like do you pick the code from two different slicer? thank you

Anonymous
Not applicable

hi @Anonymous , I'm kind of looking for something similar. Did you find a solution for this ?

 

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.