Forum Discussion
Anonymous
3 years agoNot applicable
contains string in power query
Hi
Is it possible to do something similar to the below in power query, i currently have this measure as a calculated column in my table:
IF (
CONTAINSSTRING ('Table'[Entry], "Attend" ),"Attended",
if(CONTAINSSTRING(Table [Entry], "Late"), "Late",
if(CONTAINSSTRING('Table [Entry],"Withdraw"),"Withdraw",
"Other")))
The above does work just thinking may be more efficient to complete in power query or if there is a better way to do the above as a column.
Some of the words within the text maybe attendance, attended, withdrawal, withdraw which is why i have put Attend, withdraw.
Thank you
The M code for that would be text.Contains (I'll link below) if you're wanting to go this route.
A more user friendly way to do it would be to add a conditional column and just fill out the UI it opens!
https://learn.microsoft.com/en-us/powerquery-m/text-contains
1 Reply
- SykResident Rockstar
The M code for that would be text.Contains (I'll link below) if you're wanting to go this route.
A more user friendly way to do it would be to add a conditional column and just fill out the UI it opens!
https://learn.microsoft.com/en-us/powerquery-m/text-contains