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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Syndicate_Admin
Administrator
Administrator

How to check if a column contains the characters in the column of another table

Hi, 

 

I have 2 tables below. I need to have a new column in Table1 to have a Boolean value if the Text contains any value listed in Table2 column "SearchText". I have tried to use list.ContainsAny() , but there is no space in the text so I can't use split to generate a text list. Is there any idea to achieve it? Thank!

Table1 

IDName
1coffeeprod
2ABCcigarette
3XXalcoholXX
4ddbeverages

 

Table2

SearchText
coffee
cigarette
alcohol
3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Thanks! it works for me. 

AlienSx
Super User
Super User

Hello, Jack7

    search = List.Buffer(Table2[SearchText]),
    contains = Table.AddColumn(
        Table1, "Contains", 
        (x) => List.MatchesAny(
            search, 
            (w) => Text.Contains(
                x[Name], w, Comparer.OrdinalIgnoreCase
            )
        )
    )
Syndicate_Admin
Administrator
Administrator

Hi @Jack7 ,

 

I assume that if value in Name column returns "true", otherwise, returns "false".

Please try this:

AddColumns(Table1,"test",!IsBlank(LookUp(ForAll(Table2.SearchText As C,C.SearchText in Name),Value=true)))

 

Best regards,

Rimmon

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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