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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Bassehave
Helper I
Helper I

Looking for specific text in cell based on another column

I'm trying to do a Find/Mid/Match in Power Query, but I'm not sure how to do it.

 

Basically, I have a long list of article numbers and article names - inside these articles names it's stated which colour the product is. The issue is that it's not always in the same place.

 

I have a query named "X_Colours" with one column "Colours" type is Text.

Other query is "Items" with two columns "Item No" (Number) and "Name" (Text).

 

I would like a custom column that looks in "Items" "Name" for a similar value from "X_Colours" "Colours" column. If it finds the same value, it should return the value from "X_Colours" if not, it should just return something like "Unknown", so I can manually look for the colour and add it to the list.

 

Is this possible or do I have to create a new table and use an excel formula and then add it back into the query?

Thanks in advance! 

2 REPLIES 2
amitchandak
Super User
Super User

@Bassehave ,

 

A new column in Table 2 , Items. In DAX

 

new column =

var _max = maxx(filter(X_Colours, search(X_Colours[Color], Item[Name],,0) >0) , X_Colours[Color])

return

if(isblank(_max), "Unknown", _max)

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

Hi Amitchandak,

Thanks a lot for the solution and I'm sure its what I need, but I can't seem find where to use this formula. 

When going to "Add Column" and "Custom Column" it doesn't work when I write this formula.

Is it possible to convert it to this window?

I'm trying to do this in Excel Power Query, so I'm not sure if I miss some functionality compared to Power BI query.

 

Thanks in advance!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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