Forum Discussion
vonschultz666
Helper I
3 years agoHow to mimic SQL "Full Outer Join" in M?
Hi everyone! I have one challenge I would like to resolve with Power Query, and hopefully, someone will be able to help. Currently, I have two views on two different MS SQL servers. The first v...
- 3 years ago
The change in the expected output table has changed the problem as I understood it.
If you're able to add a column into TableA specifying a single supplier, then the most efficient method would be the following:
Add a column into TableA that is just = "Firm XXX". Let's call it [A.Supplier].
Perform a Full Outer merge on [B.SupplierArticleID] & [B.Supplier] = [A.No_] & [A.Supplier].
You can do a two-field merge by using Ctrl+click on the fields in the merge dialog. Make sure to Ctrl+click the fields in the same order on each table:
This gives the following output:
Pete
slorin
Super User
3 years agoHi,
May be ?
Table.NestedJoin(
TableB, {"B.SupplierArticleID", "B.Supplier"},
Table.AddColumn(TableA, "Firm", each "Firm XXX"), {"A.No_", "Firm"},
"NewColumn",
JoinKind.FullOuter
)
Stéphane