JoinKind.RightOuter

Updated on

JoinKind.RightOuter (2) is an enumeration that specifies the kind of join operation. It is a member of the JoinKind.Type and represents a right outer join which ensures that all rows of the second table appear in the result.

Imagine this – you’re joining the ‘Left Table’ and the ‘Right Table’ on a common column. The image below shows how a ‘right outer join’ works. In this case, you get a new table that includes all elements from the ‘Right Table’ and only the matching elements from the ‘Left Table’. If there’s no match for a row from the ‘Right Table’ in the ‘Left Table’, the columns from the ‘Left Table’ will simply show as null in the resulting table.

Right Outer Join in Power Query M

Examples

The right outer join returns all rows in Table2, and adds matching records of Table1. To specify the right outer join operation for the Table.NestedJoin function you can use its 6th argument.

= Table.NestedJoin(
      CustomersTable,
      {"CustomerID_1"},
      OrdersTable,
      {"CustomerID_2"},
      "Orders"           
      JoinKind.RightOuter // specifies the JoinKind
  )

/* ----------------------------------------
    You can also write the short-hand value
 ------------------------------------------ */

= Table.NestedJoin(
      CustomersTable,
      {"CustomerID_1"},
      OrdersTable,
      {"CustomerID_2"},
      "Orders"           
      2                   // the concise way to specify the right outer join
  )

Learn more about JoinKind.RightOuter in the following articles:

  • Join Types in Power Query
    Power Query has different join types for merging queries. Mastering them allows you to easily retrieve new values, keep relevant ones or discard them.. » Read more

Other related enumerations are:

Applies to

Here’s a list of functions that work with JoinKind.Type:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot