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
rds_2019
Helper I
Helper I

Join 2 tables by using LIKE or containstring

Hi,

Is it posible to join 2 tables using LIKE instead of equal.

 

So if there are 2 tables tables1 and table 2 and join is on column1 and column11 respectively.

So can we use something like

 

WHERE table1.column1 like (%Table2.column11%)..

 

the purpose is to find like 

if column11 = xyz

and column1= axyz.... We can still join these 2

 

Presently when w join 2 tables in Model Tab it is as per = , so like

table1.column1 = table2.column11

 

Thanks

RDS

1 ACCEPTED SOLUTION

Hi @rds_2019 ,

You can try to use the function of SEARCH to find the keyword. Is there any column in your table that can link two tables? I created a sample using the function of  RELATED to combine two columns based on id. 

Column = IF(SEARCH("*efg*",'Table 1'[Column1]),RELATED('Table 2'[Column1]),BLANK())

1.PNG2.PNG

Best Regards,

Xue

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @rds_2019 ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@rds_2019  what is the purpose of joining?

If you just want to relate them you can create an index coumn in each table and then relate them. If not you like to compare and match data values between tables, you can use Calculate and firstnotblank. If you don't know how to use them let me know to make and example.

Thanks for replying. My purpose is of relating or joining 2 tables so that i can use one table's values in anoher .

So in Table1.column1 has value =

 

Column1
efg

and table2.column2 has values = 

 

Column2Column3
efgrr
efgttmm

 

I want to make sure when i design report for table1. it considers both values of table2.Column3..

Currently since join is between efg and efg.. column3's value "rr" will be considered .

I want both rr and mm of column3 should get considered in the report against value efg of table1.column1.

 

I hope i made sense to you.

 

Cheers,

RDS

Hi @rds_2019 ,

You can try to use the function of SEARCH to find the keyword. Is there any column in your table that can link two tables? I created a sample using the function of  RELATED to combine two columns based on id. 

Column = IF(SEARCH("*efg*",'Table 1'[Column1]),RELATED('Table 2'[Column1]),BLANK())

1.PNG2.PNG

Best Regards,

Xue

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.