Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not 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
1 ACCEPTED SOLUTION
Syk
Super User
Super User

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!

Syk_0-1687967039001.png

 



https://learn.microsoft.com/en-us/powerquery-m/text-contains

View solution in original post

1 REPLY 1
Syk
Super User
Super User

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!

Syk_0-1687967039001.png

 



https://learn.microsoft.com/en-us/powerquery-m/text-contains

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors