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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
jackjanice
New Member

Search in a text column for values in another table using DAX

Hi experts,

I have two tables, one is called "Data", there's a columns called "tags", the values in this column is comma separated strings, each string stands for a tag. Another table is called RegionTag table with only one column in it called Tag, this table contains all region tags.

Some sample data in the two tables look like below,

Data table:

IdTags
A101INCLUDE,APPLE,US
A102EXCLUDE,UK,ORANGE
A203ASIA,PEAR
A104PEACH

 

RegionTag table:

Tag
US
UK
ASIA

 

I need to create a "Region" column in Data table. In this table, I only need the region tag for each row. The Region column for above sample table should look like below,

IdTagsRegion
A101INCLUDE,APPLE,USUS
A102EXCLUDE,UK,ORANGEUK
A203ASIA,PEARASIA
A104PEACH(blank)

 

Is this something can be done in a DAX?

 

Thanks,

Jack

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jackjanice , Try a new column in Data table

maxx(filter(RegionTag , search(RegionTag [region], Data[Tag],,0)>0)RegionTag[region])

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

3 REPLIES 3
amitchandak
Super User
Super User

@jackjanice , Try a new column in Data table

maxx(filter(RegionTag , search(RegionTag [region], Data[Tag],,0)>0)RegionTag[region])

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

@amitchandak Hey Amit - are you able to help with below question. It is similar issue to above. But it is for Tabular Model DAX not PBI DAX. hence the solution here isn't working there. It throws error -

 

"The function MAXX takes an argument that evaluates to numbers or dates and cannot work with values of type String."

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Lookupvalue-for-a-Search-String-in-Tabular-Mo...

 

Thank you @amitchandak very much, this is exactly what I want!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.