Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I just stumbled on a difficulty for which I cannot find a simple solution yet : I am trying to add another a column from one table/query to another.
It would look like this:
| ColumnA - Original Table | ColumnA - Second Table |
| ValueA | ValueA |
| ValueB | ValueB |
| ValueC | ValueC |
| ... | ... |
From what I can understand, there is no available functionnality available to perform such operation (this post - in french - explains it well).
#"Second Table"[ColumnA]Develop columns and "finally" get the excepted result.
Note: the content has been hidden to avoid sharing sensitive data.
Additionally, why is the "Combine files" option grayed where my files are located in the same folder and share the same structure (which would have simplified my work and probably avoid this issue)?
Hi @Jamesmry ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.
Hi @Jamesmry ,
Thank you @MFelix , @pankajnamekar25 for your inputs.
We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.
Thank you.
Hi @v-echaithra
Thank you. I have replied to them, I also would appreciate your expertise for that question:
Additionally, why is the "Combine files" option grayed where my files are located in the same folder and share the same structure (which would have simplified my work and probably avoid this issue)?
Kind regards,
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:
For you to have this working you need to do the following steps:
Has I mentioned be carefull with the number of rows because you can have more values or less than you need.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix,
Thank you for your asnwer. To answer your question :
@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.
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
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?
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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |