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
ilcaa722
Frequent Visitor

Text.Contains but whole word, not part of word

I am doing a Text.Contains  for the word ace. it find ACE HARD, SKYES ACE which is good.... BUT it also finds matches that contain Palace which is bad

 

whats the best way to test a column contains a specific whole word and not part of a word?  thanks

 

(the text column has multiple words and this is just a short sample)

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You could split the text into a list and check if the list contains "ace".

 

Try this as a custom column:

List.Contains(Text.Split(Text.Lower([Column1]), " "), "ace")

 

View solution in original post

9 REPLIES 9
ilcaa722
Frequent Visitor

thanks, i tried ace with variations of spaces, but sometimes its first word,ect... also "ace " picks up Palace Ave

 

ill try Alexis solution and see if its robust acrross many examples.

Anonymous
Not applicable

True, @AlexisOlson, let's make it " ace" OR "ace ". After all, a space after ace finds that case.

Then you'd get true for both "Palace XYZ" and "XYZ Acetone".

Anonymous
Not applicable

In fact, "A space before ace if you do not need space."

Anonymous
Not applicable

"A space before ace gives palace no place."

Anonymous
Not applicable

Just look for " ace".

 

--Nate

@Anonymous  Then you don't get "ACE HARD" but you would get "XYZ ACETONE", right?

AlexisOlson
Super User
Super User

You could split the text into a list and check if the list contains "ace".

 

Try this as a custom column:

List.Contains(Text.Split(Text.Lower([Column1]), " "), "ace")

 

HotChilli
Super User
Super User

spaceacespace?

Couldn't resist that, sorry.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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 Kudoed Authors