Forum Discussion
maalsan
4 years agoAdvocate I
Find multiple substring DAX CONTAINSSTRING
Hello everyone, I need to find if the substrings "house", "home", "dewelling" appear in a long string column. Using CONTAINSSTRING I am able to find each word at a time- house= CONTAINSSTRING(tab...
- 4 years ago
That's weird. It still gives me an error message.
I found the solution to be simply:
house= CONTAINSSTRING(table1[column1], "house" ) || CONTAINSSTRING(table1[column1], "home" ) || CONTAINSSTRING(table1[column1], "dewelling" )
Without the need of IF statements.
Thanks!
Greg_Deckler
4 years agoCommunity Champion
maalsan Try:
house =
IF(
CONTAINSSTRING(table1[column1], "house") ||
CONTAINSSTRING(table1[column1], "home") ||
CONTAINSSTRING(table1[column1], "dwelling"),
TRUE(),
FALSE()
)maalsan
4 years agoAdvocate I
Thanks for the reply. However, it seems that containsstring function only allowes for 2 arguments max. I got the following error message: "Too many arguments were passed to the CONTAINSSTRING function. The maximum argument count for the function is 2".