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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Greg_MSFL
New Member

Value contained in another column ?

Hi everyone,
I search on internet but until now couldn't find a way to answer my problem :

I have two tables (and many others, but for this problem, only these two are necessary 🙂 ) :

 

The first one : contains all the manufacturers (column FABRICANT) that are forbidden for destinations (column ID_CONT).

Example :

Greg_MSFL_5-1644506328093.png

 

 

The second one : contains all the products (column ID_ART), which are possible to send in the destinations (ID_CONT), and contains all the manufacturer of the products (columns FABRICANT).

Example (I made it in Excel, but it's in PowerBI) :

Greg_MSFL_1-1644507287580.png

 

What I want : - for each product (ID_ART), to know if it's possible to send it in to the destinations. I want it in a new column in my second table.

Example :

Greg_MSFL_0-1644507275436.png

 

Explanation : AA2_DISPATCH1, product 2, contains "SHTROUMPF" in his FABRICANT, so it's KO, because it is forbidden.

 

I could easily do it if I had only one fabricant for each product, but as you see it's not the case (up to 6 fabricant for one product...).

 

I'm sure there must be a quite easy way for this, but I can't find it ...

OH, I want the solution in DAX if possible.

 

Thank you for reading me,

 

Greg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Greg_MSFL , based on what I got

 

New column in Table 2  =

 

var _cnt = countx(filter(Table1, table1[ID_CONT] = table2[ID_CONT] && table1[FABRICANT] = table2[FABRICANT] ) , table1[ID_CONT] )

return

if(isblank(_cnt), "OK", "KO")

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Greg_MSFL , based on what I got

 

New column in Table 2  =

 

var _cnt = countx(filter(Table1, table1[ID_CONT] = table2[ID_CONT] && table1[FABRICANT] = table2[FABRICANT] ) , table1[ID_CONT] )

return

if(isblank(_cnt), "OK", "KO")

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

Hi amitchandak,

Awesome, it works perfectly !

I just changed it a little, because I want to know if the value of Table1 is contained in Table2. So it's now :

Column2 =
var _cnt = countx(filter(Table1,Table1[ID_CONT]=Table2[ID_CONT] && CONTAINSSTRING(Table2[FABRICANT],Table1[FABRICANT])),Table1[ID_CONT])
return
if(isblank(_cnt),"OK","NOK")
 
Thanks a lot !
Have a great day,
Greg

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.