Forum Discussion

Jakez's avatar
Jakez
New Member
3 years ago
Solved

How to join two tables which are non unique

Hi All,   I have two tables as shown below and i want to merge them together to do some analysis in Powerbi, original source of the data is excel files. I want to join the table using two columns D...
  • AntrikshSharma's avatar
    3 years ago

    Jakez 

    1. Disable "Auto Detect Relationship" under file settings.
    2. Before loading data make sure there are no existing relationships.
    3. You can join 2 table by using DealerID and Date as the Key
    let
        Source = 
            Table.NestedJoin (
                Table1,
                { "Dealer_id", "Date" },
                Table2,
                { "Dealer_id", "Date" },
                "Table2",
                JoinKind.LeftOuter
            ),
        ExtractedSales = Table.ExpandTableColumn ( Source, "Table2", { " Sales" }, { " Sales" } )
    in
        ExtractedSales