cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
user180618
Helper I
Helper I

Mapping columns from different tables where one has multiple delimited values

I have two tables that I would like to map together, either using a join or relationship or a lookup (not sure which is most appropriate). In Table 1 I have a column that lists English words/slang and the different ways they are said across US, UK and Australian English separated by commas:

 

Column1.words
cigarettes, cigs, butts, f*gs, durry
tracksuit bottoms, tracksuits, sweatpants, trackies, dacks

 

In Table 2, I have the categorisations of the words by US, UK and Australian:

US_englishUK_englishAU_english
cigsf*gsdurry
candysweetslollies
sweatpants  trackiestrackies

 

I want to have a Column2 in Table 1 that pulls out a word from the list Column1 list (cigarettes, cigs...) based on the US_english table column in Table 2, so that my Table 1 then has two columns like this:

 

Column1.wordsColumn2.matched
cigarettes, cigs, butts, durrycigs
tracksuit bottoms, tracksuits, sweatpants, trackies, dacks  sweatpants

 

What would be the best way to do this?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @user180618 
Please try

Matched =
MAXX (
    FILTER (
        VALUES ( Table2[US_english] ),
        CONTAINSSTRING ( Table1[Word], Table2[US_english] )
    ),
    Table2[US_english]
)

The MAXX shall not be required and can be removed

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @user180618 
Please try

Matched =
MAXX (
    FILTER (
        VALUES ( Table2[US_english] ),
        CONTAINSSTRING ( Table1[Word], Table2[US_english] )
    ),
    Table2[US_english]
)

The MAXX shall not be required and can be removed

I'm getting this error: Expression.Error: The name 'MAXX' wasn't recognized. Make sure it's spelled correctly.

 

When I remove MAXX I get a 'Token RightParen expected' error on the comma in the third-last line.

@user180618 

Would you post a screenshot of the DAX code that you have used?

Never mind, it worked now. I was doing it in Power Query not Power BI.

 

Thanks very much!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors