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! Request now

Reply
jcastr02
Post Prodigy
Post Prodigy

Search for word in multiple columns

Hello,

 

I am trying to have a conditional column or custom column that would show yes or no if a specific word comes up in multiple columns.

 

Example  if the word "Apple" is contained  in col A, B, or C, then "Yes" if not, "No"

 

Follow up question - Is there case sensitivity with the search of the word Apple?  

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@jcastr02  insensitive with SEARCH, sensitive with FIND

 

Column = switch(true(),search("apple",'Table'[Column1],1,0)=1&&search("apple",'Table'[Column2],1,0)=1&&search("apple",'Table'[Column3],1,0)=1,"yes","no")

 

smpa01_0-1634238027998.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @jcastr02 

1.  Create a new table, as shown in the figure, including various possibilities.

vzhangti_0-1634534788621.png

2.  Create a new calculated column in desktop, and use IF and SEARCH functions.

Column = IF(SEARCH("apple",'Table'[A]&" "&'Table'[B]&" "&'Table'[C],1,0),"yes","no")

vzhangti_1-1634534788625.png

Best Regards,

Charlotte Zhang

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

sevenhills
Super User
Super User

For case sensitivity, you have to use FIND, ContainsStringExact. 

SEARCH is NOT case sensitive 

 

For your needs, you can try this: (I used "APPle" to show case sensitive)

 

Column = IF(AND(ContainsStringExact('Table'[Column1], "APPle"), ContainsStringExact('Table'[Column2], "APPle"), ContainsStringExact('Table'[Column3], "APPle")), "Yes", "No")

 

 

Hope this helps!

 

FYI: I agree with "Power Query is more efficient way", due to data compression and other internal implementaion. 

TomMartens
Super User
Super User

Hey @jcastr02 ,

 

next to the approach @smpa01 already presented, I tend to use Power Query to create calculated columsn, assuming we are have a dataset in import mode or the function will be folded, as the function I propose will not fold.

 

Create a column using Power Query usint the function List.Contains( { [ col1 ] , ... , [col4] } , ... )

This article by Chris Webb is a must read: https://blog.crossjoin.co.uk/2017/01/22/the-list-m-functions-and-the-equationcriteria-argument/

 

I prefer calculated columns created by Power Query as these columns will be compressed.

 

Hopefully this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
smpa01
Super User
Super User

@jcastr02  insensitive with SEARCH, sensitive with FIND

 

Column = switch(true(),search("apple",'Table'[Column1],1,0)=1&&search("apple",'Table'[Column2],1,0)=1&&search("apple",'Table'[Column3],1,0)=1,"yes","no")

 

smpa01_0-1634238027998.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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