Forum Discussion
PowerBINoob24
Resolver I
3 years agoCreating a Column using a Nested Find
Hello all: I'm trying to create a column where the value will be based off and email domain. The below is what I have, but it keeps throwing an error. Country = IF (FIND("@Domain1.com", IF (FIN...
- 3 years ago
So, if the domain is equal to one of the four then it is Canada otherwise US? Maybe this will work for you:
Column = IF ( CONTAINSSTRING ( 'Table'[Email Address], "@Domain1.com" ) || CONTAINSSTRING ( 'Table'[Email Address], "@Domain2.com" ) || CONTAINSSTRING ( 'Table'[Email Address], "@Domain3.com" ) || CONTAINSSTRING ( 'Table'[Email Address], "@Domain4.com" ), "Cananda", "US" )
PowerBINoob24
Resolver I
3 years agoThat's not quite what I need. Need to find the four specific domains, not just the first one it finds.
Barthel
Solution Sage
3 years agoSo, if the domain is equal to one of the four then it is Canada otherwise US? Maybe this will work for you:
Column =
IF (
CONTAINSSTRING ( 'Table'[Email Address], "@Domain1.com" )
|| CONTAINSSTRING ( 'Table'[Email Address], "@Domain2.com" )
|| CONTAINSSTRING ( 'Table'[Email Address], "@Domain3.com" )
|| CONTAINSSTRING ( 'Table'[Email Address], "@Domain4.com" ),
"Cananda",
"US"
)- PowerBINoob243 years ago
Resolver I
Thanks! That got it. What is the purpose of the double pipes at the beginning of the lines?
- Ashish_Mathur3 years ago
Super User
That's the OR operator.