Forum Discussion
aso1
6 years agoHelper II
if statement column
I have a column with different usernames. some contain some prefixes such as "DOMAIN\" and others dont have these prefixes. I want a custom column that attaches a text if X is something. Exactly l...
- 6 years ago
Hi aso1 ,
Try this for a custom column on Power Query:
if Text.StartsWith(Text.Upper([Column1]), "NT SERVICE")
or Text.StartsWith(Text.Upper([Column1]), "NT AUTHORITY")
then "SQL System"
else
if Text.StartsWith(Text.Upper([Column1]), "DOMAIN\") then
"Windows Authentication"
else "SQL Authentication"
Pragati11
6 years agoSuper User
HI aso1 ,
You can create a calculated column using DAX as follows:
ifContainsString = IF(CONTAINSSTRING(youTable[Name], "NT SERVICE") = TRUE() || CONTAINSSTRING(youTable[Name], "NT Authority") = TRUE(), "SQL System",
IF(CONTAINSSTRING(youTable[Name], "DOMAIN\") = TRUE() , "Windows Authentification", "SQL Authentification"))
Thanks,
Pragati