Forum Discussion
[PowerQuery] add (same) column from another table
- 3 months ago
Hi Jamesmry ,
Thank you for your follow up. Regarding your additional questions:
Power Query is designed around table transformations and relational operations, so bringing data from another table is typically handled through Merge Queries rather than a direct “copy matching column” button in the UI. While it may feel like a missing shortcut, the intended approach is to explicitly define how the two tables relate (common key, join type, etc.), which provides more control and reliability for different data scenarios.
As for the Combine Files option being grayed out, this usually happens when the source is not connected through the Folder connector. The Combine Files feature is specifically enabled when you import data using Get Data > Folder, where Power Query can detect multiple files in one location and apply the same transformation pattern across them. If the files are loaded individually or through another connector, that option may remain unavailable.
To add a column from another table, the recommended method is Merge Queries + Expand.
To use Combine Files, connect through the Folder source so Power Query can recognize the files as a group.
Hope this clarifies the behavior.Thank you.
Hi Jamesmry ,
Does the two tables have some common field like an ID or do you just want to copy the column exactly in the same position so for the first line you have the first value and so on?
If there is a common column then you need to do a merge based on that common column and that will give you a new column that you can then expand.
If however you don't have a common column then it's important to be aware of:
- Number of rows match between both tables
- You must sort both tables properly before doing the next steps
For you to have this working you need to do the following steps:
- Sort the tables in the proper order (if needed)
- Add a Index column to your tables (on both of them)
- Now do the merge based on that index column on the table you want and then expand the column from the other table
Has I mentioned be carefull with the number of rows because you can have more values or less than you need.
Hi MFelix,
Thank you for your asnwer. To answer your question :
- the tables have more than one common column (as shown in the screenshots, althrough written in French).
- I want to be able to merge the tables so that the values of the common column are exactly at the same position (as shown in the table in my post).
MFelix wrote:If there is a common column then you need to do a merge based on that common column and that will give you a new column that you can then expand.
That is exactly what I am trying to do and as explained in my post.
Providing those answers, what is your opinion now on the subject?
I have not thought about the index column. I’ll give that a go as well.