Forum Discussion

icturion's avatar
icturion
Icon for Resolver II rankResolver II
4 years ago
Solved

See if column string contains multiple text values

Hi,   Is there a way to search for two or more words within the same string of text?   I already tried with containsstring but then I can only give one word.   Example data: Column this ...
  • Samarth_18's avatar
    4 years ago

    Hi icturion ,

     

    Create a column with below code:-

    Column 2 =
    SWITCH (
        TRUE (),
        CONTAINSSTRING ( 'Table (4)'[Column], "text" )
            && CONTAINSSTRING ( 'Table (4)'[Column], "search" ), "Group 1",
        CONTAINSSTRING ( 'Table (4)'[Column], "sentence" )
            && CONTAINSSTRING ( 'Table (4)'[Column], "different" ), "Group 2",
        "Group 3"
    )

    Output:-

     

    Thanks,

    Samarth