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.
Hello Jamesmry
Try this code
let
Source = Original,
Merged = Table.NestedJoin(
Source,
{"ColumnA"},
Second,
{"ColumnA"},
"SecondTable",
JoinKind.LeftOuter
),
Expanded = Table.ExpandTableColumn(
Merged,
"SecondTable",
{"ColumnA"},
{"ColumnA_Second"}
)
in
Expanded
If my response helped you, please consider clicking
Accept as Solution ✅ and giving it a Like 👍 – it helps others in the community too.
Thanks,
Connect with me on:
Hi pankajnamekar25,
Thank you for your answer.
I would like to avoid using the M script but let's say I try & use it: how do you implement your script when I already have a Table.NestedJoin(...) function embedded in one of the tables I would like to merge?
Let me explain: one or both tables are already the product of merged data.
Therefore, in one of them (which I would like to use to merge with a new one), I already have the following embedded M script:
let
Source = Table.NestedJoin(#"Table1", {"ColumnA"}, #"Table2", {"ColumnA"}, "Table1", JoinKind.FullOuter)
in
Source
How do you implement yours in this?
- v-echaithra4 months agoCommunity Support
Since your query already includes a Table.NestedJoin, there’s no need to change it, simply add another merge step that builds on the existing result.
let
Source = Table.NestedJoin(
#"Table1",
{"ColumnA"},
#"Table2",
{"ColumnA"},
"Table2_Data",
JoinKind.LeftOuter
),#"Expanded Table2" = Table.ExpandTableColumn(
Source,
"Table2_Data",
{"ColumnFromTable2"}
),#"Merged Table3" = Table.NestedJoin(
#"Expanded Table2",
{"ColumnA"},
#"Table3",
{"ColumnA"},
"Table3_Data",
JoinKind.LeftOuter
),#"Expanded Table3" = Table.ExpandTableColumn(
#"Merged Table3",
"Table3_Data",
{"ColumnFromTable3"}
)
in
#"Expanded Table3"Handle each merge as a separate step in your query. Every merge creates a new intermediate table, and you should continue building on that result. After each merge, expand the nested column right away to keep the structure flat and easy to manage.
Avoid working inside nested columns like "Table1". These are not regular columns and shouldn’t be used for further merges. Instead, always perform joins at the main table level.
In short, keep your existing Table.NestedJoin as is, simply add another merge step on top of its output and expand it immediately to maintain a clean and maintainable query.
Hope this helps.- Jamesmry4 months agoNew Member
Hi v-echaithra,
Thank you for your detailed answer.
Would you mind answering the other one? About the missing function & grayed option?
My workflow has morphed a bit and have stand-byed the task requiring the answers to this post. Therefore I will wait until I have the opportunity to test & accept one of the suggested solutions.
- v-echaithra3 months agoCommunity Support
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.