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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Salle
Advocate I
Advocate I

Modify "Text.contain" in Power Query to look and identify exact string of text

Background:

I want to create a new table column in power query.

Every time the exact word "abc" is found in [TITLE], abc shall be written in the new Column otherwise N/A.
Column
abc
abc
N/A
...

Code

= Table.AddColumn(#"Summary", "Column", each if Text.Contains([TITLE], "abc") then "abc" else "N/A"


Problem

However with the above function I also get a true value for all word containing abc, for example abcd, aabc etc.

Is there a way in Power Query to look for the exact word and spelling? Similar to the DAX function CONTAINSSTRINGEXACT

 

Thanks in advance.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use this

if List.Contains(Text.Split([TITLE]," "), "abc") then "abc" else "N/A"

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Use this

if List.Contains(Text.Split([TITLE]," "), "abc") then "abc" else "N/A"

Thank you! Seems to be working as expected.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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