Forum Discussion

tomgag's avatar
tomgag
Resolver I
8 years ago
Solved

Find text annd exclude certain strings

Hi, I want to find the string withing my column and exlude if certain strings are present. I use the following code:

 

Lookup= IF (ISBLANK ( SEARCH ( "Ronaldo", Table[Column], 1, BLANK () ) ),
"",
"Ronaldo"
)

 

It gives me Ronaldo or NULL values but I want to exclude when Messi or/and Pogba are present in the string Table[Column].

  • tomgag's avatar
    tomgag
    8 years ago

    Solution is:

     

    Ball = IF (NOT(ISBLANK ( SEARCH ( "Messi", 'Table'[Column], 1, BLANK () ) ))

    && ISBLANK ( SEARCH ( "Ronaldo", 'Table'[Column], 1, BLANK () ) )

    && ISBLANK ( SEARCH ( "Pogba", 'Table'[Column], 1, BLANK () ) ), 1, 0)

3 Replies

  • you can add the add and or condition to your if statement (for and use && and for or use ||)

     

    If you explain what is your logic, will get you the expression.

     

     

    • tomgag's avatar
      tomgag
      Resolver I

      Solution is:

       

      Ball = IF (NOT(ISBLANK ( SEARCH ( "Messi", 'Table'[Column], 1, BLANK () ) ))

      && ISBLANK ( SEARCH ( "Ronaldo", 'Table'[Column], 1, BLANK () ) )

      && ISBLANK ( SEARCH ( "Pogba", 'Table'[Column], 1, BLANK () ) ), 1, 0)