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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter a table based on string values in another table

Hi everybody,

Suppose I have the following table, "Table 1", that has a Serial Code column containing a string of text. I am trying to filter this table based on whether or not the Serial Code contains particular substrings. The substrings I want to check for are listed in another table, "Table 2".

 

Table 1 
RowSerial Code
1ABC***********
2*****************
3***DEF********
4*******XYZ****
5***ABC***DEF***
6****************
7****************
8XYZ***ABC*********
9******************
10DEF*******XYZ*****

 

Table 2
Substrings
ABC
DEF
XYZ

 

Basically the logic is: For each row in Table 1, check if the Serial Code contains any of the Substrings listed in Table 2. If yes, keep the rows. If no, filter out the rows. So the resulting table will be as below.

 

Result 
RowSerial Code
1ABC***********
3***DEF********
4*******XYZ****
5***ABC***DEF***
8XYZ***ABC*********
10DEF*******XYZ*****

 

Is this possible with DAX?

 

Thank you for reading!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can try a new column like

 

New column =
var _1 =countx( filter(Table2, search(Table2[Substrings], Table[Serial Code],,0)> 0),Table2[Substrings])
return
if(not(isblank(_1)),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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can try a new column like

 

New column =
var _1 =countx( filter(Table2, search(Table2[Substrings], Table[Serial Code],,0)> 0),Table2[Substrings])
return
if(not(isblank(_1)),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

Thank you very much, @amitchandak. This was a helpful suggestion!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors