Perform an Anti Join in Power BI
Perform an Anti Join in Power BI, If you’re working with multiple tables in Power BI and need to identify and analyze data that lacks corresponding values in another table, an anti join is your best option.
This technique allows you to return all rows from one table that do not have matching values in another, making data analysis more targeted and efficient.
Perform an Anti Join in Power BI
In this article, we’ll walk through how to perform an anti join in Power BI using the Merge Queries function in Power Query Editor.
What is an Anti Join?
An anti join is a specific type of join that returns records from one table that do not have matching values in another table.
This is particularly useful for identifying discrepancies, missing data, or specific subsets of data based on unique criteria.
Example: Performing an Anti Join in Power BI
Scenario Overview
Let’s imagine you have two tables in Power BI:
- Table 1 (
data1
): This table contains information about basketball players, specifically their team names and points scored. - Table 2 (
data2
): This table contains information about the same basketball players, focusing on their team names and rebounds.
Goal
Our goal is to perform an anti join to retrieve all rows from data1
that do not have matching team names in the data2
table.
Step-by-Step Instructions
Step 1: Open Power Query Editor
- Click on the Home tab in Power BI.
- Click the Transform Data icon. This will open the Power Query Editor.
Step 2: Merge Queries
- In the Power Query Editor, locate the Combine group on the Home tab.
- Click on Merge Queries from the options.
- Select Merge Queries as New from the dropdown menu. A new window will pop up.
Step 3: Configure the Merge
- In the new window, choose
data1
as the first table. - Select
data2
as the second table. - For Join Kind, select Left Anti.
- Click on the header for the Team column in both tables to indicate that you want to join based on those columns.
Step 4: Complete the Merge
- Click OK to execute the anti join.
- In the resulting table, click on the left and right arrows at the header of the
data2
column. - Check the box next to Rebounds to include this column from
data2
in the final merged table.
Step 5: Confirm and Apply Changes
- After adjusting the columns, click OK to finalize your selections.
- Exit the Power Query Editor. A message box will appear prompting you to apply your changes.
- Click Yes.
Result
You will now see a new table named Merge1 in the Table view.
This table will contain all rows from data1
that do not have matching values in the Team column of the data2
table.

Optional: Rename Columns
To improve clarity, you can right-click on the header data2.Rebounds
and rename it to simply Rebounds for easier reference.
Conclusion
Performing an anti join in Power BI is straightforward using the Power Query Editor and the Merge Queries function.
This technique enhances your data analysis capabilities by allowing you to focus on the unique records that merit attention.
By following the steps outlined above, you can efficiently execute an anti join and leverage your data insights to make informed decisions.
For more advanced Power BI techniques, consider exploring other types of joins, such as Left Joins, to broaden your data analysis toolkit.
Happy analyzing!