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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.