cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Combine 2 columns from 2 different tables together (different lengths)

Hello, 

 

I have been struggling trying to merge these 2 columns from 2 tables. 

 

Let's call these 2 tables Table 1 and table 2. There is a relationship already established between them (Table 1 - [user_id]) & table 2 - [id]). Table 1 has 717 rows and table 2 has around 1888 rows. 

 

I am trying to create a new table that has [customers] from table 2 and [date] from table 1. 

Both tables has the [machine_id] columns which I think I need to use in order to match the [customers] and [date] together. Or maybe I can use the [id] & [user_id] as their relationship was already established. 

 

I am completely clueless on how I can do this and would appreciate someone to help me with this. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi, 

Thanks for the reply. I found out using Queries is much easier to use and get what  I wanted!!! 

View solution in original post

5 REPLIES 5
Highlighted
Microsoft
Microsoft

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi @okiedokie2017,

Based on your understanding, there must be a 1:n relationship between Table1(1) and Table2(n). So please follow the steps below.

1. In table2, create a calculated column using the formula

date=RELATED(Table1[date])

2. Then click "New Table" under Modeling on home page, type the formula to create a new table including  [customers] from table2 and [date] from table 1.

NewTable=SELECTCOLUMNS(Table2,"date",Table2[date],"customers",Table2[customers])


You will get expected table, please feel free to ask if you have any question.

Best Regards,
Angelia

Highlighted
Super User V
Super User V

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi,

 

Difficult to suggest without seeing your data.  Share the link from where your file can be downloaded.  Also, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Microsoft
Microsoft

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi @okiedokie2017,

Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Best Regards,
Angelia

Highlighted
Helper I
Helper I

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi, 

Thanks for the reply. I found out using Queries is much easier to use and get what  I wanted!!! 

View solution in original post

Highlighted
Microsoft
Microsoft

Re: Combine 2 columns from 2 different tables together (different lengths)

Hi @okiedokie2017,

Congratulations, please mark your reply as answer, so more people will benefit from here.

Best Regards,
Angelia

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors