Forum Discussion

vonschultz666's avatar
3 years ago
Solved

How 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...
  • BA_Pete's avatar
    BA_Pete
    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