You are on page 1of 5

Full outer join

Article • 10/12/2021 • 3 minutes to read • Is this page helpful?  

One of the join kinds available in the Merge dialog box in Power Query is a full outer
join, which brings in all the rows from both the left and right tables. More information:
Merge operations overview

This article uses sample data to show how to do a merge operation with the full outer
join. The sample source tables for this example are:

Sales: This table includes the fields Date, CountryID, and Units. CountryID is a
whole number value that represents the unique identifier from the Countries
table.
Countries: This is a reference table with the fields id and Country. The id field
represents the unique identifier for each record.

In this example, you'll merge both tables, with the Sales table as the left table and the
Countries table as the right one. The join will be made between the following columns.

Field from the Sales table Field from the Countries table

CountryID id

The goal is to create a table like the following, where the name of the country appears
as a new Country column in the Sales table. Because of how the full outer join works, all
rows from both the left and right tables will be brought in, regardless of whether they
only appear in one of the tables.

To perform a full outer join

1. Select the Sales query, and then select Merge queries.


2. In the Merge dialog box, under Right table for merge, select Countries.
3. In the Sales table, select the CountryID column.
4. In the Countries table, select the id column.
5. In the Join kind section, select Full outer.
6. Select OK
 Tip

Take a closer look at the message at the bottom of the dialog box that reads "The
selection matches 4 of 4 rows from the first table, and 3 of 4 rows from the second
table." This message is crucial for understanding the result that you get from this
operation.

In the Countries table, you have the Country Spain with id of 4, but there are no
records for CountryID 4 in the Sales table. That's why only three of four rows from the
right table found a match. All rows from the right table that didn't have matching rows
from the left table will be grouped and shown in a new row in the output table with no
values for the fields from the left table.
From the newly created Countries column after the merge operation, expand the
Country field. Don't select the Use original column name as prefix check box.

After performing this operation, you'll create a table that looks like the following image.
Recommended content

Right outer join - Power Query


An article on how to do a merge operation in Power Query using the right outer join kind.

Inner join - Power Query


An article on how to perform a merge operation in Power Query using the Inner join kind.

Left outer join - Power Query


An article on how to do a merge operation in Power Query using the left outer join kind.

Split columns by delimiter - Power Query


An article on how to Split columns by delimiter into new columns or rows using Power
Query.

Show more S

You might also like