Forum Discussion
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].
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
- parry2kSuper User
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.
- v-jiascu-msftMicrosoft Employee
- tomgagResolver 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)