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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lichan
Frequent Visitor

Matching partial text from TableA to TableB

I'm trying to match an Address column in TableA from a column from TableB name Sites.

 

I tried adding a new column in TableA to give me True/False results based on the search but I'm unable to input TableB without an error? 

 

This is the formula I used:

Column = IF((SEARCH('TableB'[Sites], [Address]), [True, False]))
 
TableA:
First NameLast NameAddressNew Column I want to create
JohnDoe123 Main St Apt 203True
Johnthan Dow123 Main Street, Apartment 419True
JaniceDow999 Market Street, suite 103False
JaneDoe123 Main Street aprt 301True

 

TableB:

Sites
123 Main
222 2nd
333 3rd

 

 I've also tried converting it into the list using the same formula but it still wouldn't work. Open to any suggestion. 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @lichan,

I think both search and find function should suitable for your scenario, you can also take a look at the following blog about a similar usage: (notice: find functions is case sensitive)

DAX – “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @lichan,

I think both search and find function should suitable for your scenario, you can also take a look at the following blog about a similar usage: (notice: find functions is case sensitive)

DAX – “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@lichan , Try a new column like in table A

if(isblank(countx(filter(tableB, search(Tableb[Sites], tableA[Address],,0)>0),Tableb[Sites])),true(), false())

 

Refer copy value from one table to another: https://www.youtube.com/watch?v=czNHt7UXIe8

StefanoGrimaldi
Resident Rockstar
Resident Rockstar

ok, for table A go over to power query, copy the column to a new column, separate it by dilimiter being the delimiter a blank space, you would get a column with the adress initial numbers ids lets say ( delete the others resulting columns), do the same for table B, them apply changes of the query and make a relationship between those 2 columns over in your data model if you dont need the relationship but only the column you can use a dax new column 

 

new columns =if( (lookupvalue ( table b[sites column], table B[new query column with sites numbers] , table B[new query column with sites numbers]))<>blank(),TRUE(),FALSE() )

 

if this solved your question please mark as solution, if you liked the solution give some kudos 🙂





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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