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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to search a string inside a text field ?

Hello Everyone,

I am looking for a solution where I have to search for a particular keyword, let say "NFR" from a text field.

I tried with CONTAINSSTRING() , Find() in my dax . But nothing helped. Below is my DAX.
        Find NFR = IF ( FIND ( "nfr", LOWER ( [Summary] ),, 0 ) > 0, 1, 0 )
But in stead of searching only "NFR" keyword in a whole, It is also considering "infrastructure", bcoz it has "nfr". I dont want that.
I want only individual keyword "NFR" from the text field.KIndly help.
 

Thanks In Advance

2 ACCEPTED SOLUTIONS

@Anonymous , Then Search, find and containssting should work

 

if(SEARCH("nfr",[Summary],,0)>0,1,0) //Search is case-insensitive  , so no need pf lower

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @Anonymous 

You may use CONTAINSSTRING function or Search function (like   replied before) to build measure or calculated column to find "NFR" in text field. And Find function will recognize letter case, so the result is incorrect.

I build a sample table to have a test.

1.png

Measure:

 

Find NFR 2 = IF(CONTAINSSTRING(MAX('Table'[Summary]),"NFR"),1,0)

 

Calculated column:

 

C_Find NFR = IF(CONTAINSSTRING('Table'[Summary],"NFR"),1,0)

 

Result:

2.png

You can download the pbix file from this link: How to search a string inside a text field ?

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

You may use CONTAINSSTRING function or Search function (like   replied before) to build measure or calculated column to find "NFR" in text field. And Find function will recognize letter case, so the result is incorrect.

I build a sample table to have a test.

1.png

Measure:

 

Find NFR 2 = IF(CONTAINSSTRING(MAX('Table'[Summary]),"NFR"),1,0)

 

Calculated column:

 

C_Find NFR = IF(CONTAINSSTRING('Table'[Summary],"NFR"),1,0)

 

Result:

2.png

You can download the pbix file from this link: How to search a string inside a text field ?

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

amitchandak
Super User
Super User

@Anonymous , if you only want nfr

then you can do

if(LOWER ( [Summary] ) ="nfr",1,0)

 

at start

if(left(LOWER ( [Summary] ),3) ="nfr",1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I want only these key words in my search.  But "NFR" can be anywhere within the Summary field , which is of 200-300 character length string

NFR
NFR:
NFR -
*NFR*

 

 Thanks 

@Anonymous , Then Search, find and containssting should work

 

if(SEARCH("nfr",[Summary],,0)>0,1,0) //Search is case-insensitive  , so no need pf lower

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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