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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Search text in another table column

Hi,

I have two tables and I want to search a text from one table to the other :

Fruits_List

 

Fruit_Name
Apple
Banana
Grape

 

Shop

Merchandize_Description
Yellow big zise Banana
Apple
Kids toy

 

I want to have the following column output:

Shop

Merchandize_DescriptionIs_Fruite
Yellow big zise BananaYes
AppleYes
Kids toyNo

 

I tried different formulas but I keep getting wrong output. Everything I tried gives me the right answer only when the values are exactly matching:

Merchandize_DescriptionIs_Fruite
Yellow big zise BananaNo
AppleYes
Kids toyNo

 

Here are the formulas I tried:

 

 

 

Is_Fruit = IF(Calculated(COUNTROWS(Fruits_List), FILTER(Fruits_List, FIND(Fruits_List[Fruit_Name], EARLIER(Shop[Merchandize_Description]),,-1)))>0), "Yes","No")
Is_Fruit = IF(Calculated(COUNTROWS(Fruits_List), FILTER(Fruits_List, CONSTAINSSTRING(Shop[Merchandize_Description], Fruits_List[Fruit_Name],,-1)))>0), "Yes","No")
Is_Fruit = IF(Calculated(COUNTROWS(Fruits_List), FILTER(Fruits_List, ISNUMBER(SEARCH(Fruits_List[Fruit_Name], EARLIER(Shop[Merchandize_Description]),1,Blank())))>0), "Yes","No")

 

 

 

 

I feel I am missing something. Any advice?

 

Thank you,

B

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=IF(SUMX(Fruits,FIND(UPPER(Fruits[Fruit_Name]),UPPER(Merchandise[Merchandize_Description]),,0)) > 0,"Yes","No")

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=IF(SUMX(Fruits,FIND(UPPER(Fruits[Fruit_Name]),UPPER(Merchandise[Merchandize_Description]),,0)) > 0,"Yes","No")

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.