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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pheinue
New Member

How to use text.contain to lookup the string in another table's value.

my original code.  which is too long. I want to use a list to check and reference the output result.

 

= Table.AddColumn(#"Removed Duplicates", "Custom", each if Text.Contains([项目名称], "淀粉") then "scatch" else if Text.Contains([项目名称], "农产品") then "Argo" else if Text.Contains([项目名称], "玉米") then "Corn" else if Text.Contains([项目名称], "面粉") then "Flour" else if Text.Contains([项目名称], "谷物") then " grain" else if Text.Contains([项目名称], "蘑菇") then "mushroom"else if Text.Contains([项目名称], "植物") then "Plant" else "OTHER")

 

another table with a key list

Customer activity

Sales Unit

Chinese translation

Starch

Agro

淀粉

Agro

Agro

农产品

Corn

Agro

玉米

Flour/ grain

Agro

面粉/谷物

Mushroom

Agro

蘑菇

 

1 REPLY 1
amitchandak
Super User
Super User

@pheinue , refer if this can help

https://www.myonlinetraininghub.com/searching-for-text-strings-in-power-query

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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