Table of Contents
The Anti Join is a fundamental operation in advanced data analysis, particularly within modern Business Intelligence platforms such as Power BI. Its primary function is to compare two distinct tables—often referred to as the left table (primary) and the right table (lookup)—and return only those records from the left table that have no corresponding match in the right table based on a specified key column. This specialized filtering capability is tremendously valuable for identifying data exceptions, highlighting omissions, or segmenting records that fall outside expected parameters, making it a critical tool for data quality checks and targeted business strategies.
To execute this powerful operation within Power BI, users rely on the versatile Merge Queries function, which is nested within the robust environment of the Power Query Editor. When configuring the merge, selecting the “Left Anti” join type is the key step that invokes the specific logic of the Anti Join, ensuring that the resulting table contains only the unmatched rows from the initial source table. Understanding this mechanism allows data professionals to move beyond standard joins and perform highly specific data comparisons essential for deep analytical dives.
An anti join is conceptually straightforward: it allows you to return all rows exclusively residing in your primary table (the ‘left’ table) that do not possess matching values in a secondary table (the ‘right’ table). This inverse matching process is crucial for isolation.
In the context of Power BI, the most efficient and user-friendly way to execute an anti join between two data tables involves leveraging the built-in Merge Queries function, easily accessible within the Power Query Editor interface. This graphical approach simplifies what might otherwise be complex SQL syntax.

The subsequent sections will provide a detailed, step-by-step example demonstrating precisely how to apply this technique in a practical dataset context, ensuring a complete mastery of the process.
Understanding the Concept of an Anti Join
The Anti Join serves as a powerful differentiator in the world of relational data operations. While standard joins (like Inner or Left Outer) focus on inclusion—finding overlap or retaining all records from one side—the Anti Join focuses squarely on exclusion. It operates by performing a lookup on the key column of the secondary table and discarding any row from the primary table where a match is found. The result set is, therefore, the complete set of non-matching records from the primary source, providing a clean, filtered list of exceptions.
Analysts often confuse the Anti Join with a standard Left Outer Join followed by a filter for null values. While the resulting data output can be similar, the underlying mechanism and intent are distinct. The Anti Join is fundamentally optimized for exclusion and typically results in cleaner, more efficient query execution when the sole goal is to identify missing relationships. It’s a specialized tool for scenarios where the definition of success lies in identifying items that do not exist in a specific context or relationship.
When working within the Power BI environment, particularly within the M language used by the Power Query Editor, this operation is executed by selecting the “Left Anti” type. The nomenclature is critical: “Left” signifies that all output rows must originate from the first table selected (the Left table), and “Anti” confirms the inverse matching condition—only non-matches are retained. This specificity ensures data integrity and predictable results, which are vital for reliable data modeling.
Why Use an Anti Join in Power BI? (Use Cases)
The practical applications of the Anti Join extend across many analytical domains, offering clear solutions for common data quality and segmentation challenges. One primary use case involves inventory management or auditing. For instance, if you have a master list of all serialized products (Table A) and a list of all products currently checked into the warehouse (Table B), an Anti Join allows you to quickly generate a report listing only the products that are unaccounted for or lost.
From a customer relationship management (CRM) perspective, Anti Joins are essential for segmenting inactive or non-responsive users. Imagine having a table of all registered users (Table A) and a table of users who have logged in or clicked an email link in the last 30 days (Table B). An Anti Join of A against B immediately provides a list of potentially churned or disengaged users, enabling immediate, targeted re-engagement campaigns. This capability dramatically streamlines marketing efforts by focusing resources where they are most needed.
Furthermore, Anti Joins are indispensable for data validation and identifying foreign key violations before loading data into a final model. If Table A contains transaction records referencing a product ID, and Table B is the authoritative product master list, an Anti Join helps identify transaction records containing product IDs that do not exist in the master list. This flags dirty data or input errors, ensuring the overall quality and reliability of the data warehouse or Power BI model before final deployment.
The Power BI Toolkit: Preparing for the Merge
Before executing the Anti Join, it is essential to access the data transformation environment within Power BI Desktop. The process begins by navigating to the Home tab on the Power BI ribbon and selecting the Transform data icon. This action launches the separate window for the Power Query Editor, which is the dedicated workspace for data manipulation, cleaning, and integration operations. All merging and joining activities must be performed within this editor.
Once inside the Power Query Editor, ensure both source tables that will participate in the join are loaded and visible in the Queries pane on the left. It is crucial at this stage to clearly identify which table will serve as the primary (Left) table—the one from which unmatched rows will be preserved—and which will serve as the lookup (Right) table—the one used solely for comparison and exclusion. Misidentifying the tables will result in an inverted and incorrect set of output results.
The actual operation is initiated by locating the Merge Queries option, found within the Combine group on the Home tab of the Power Query Editor. Analysts typically select Merge Queries as New to preserve the integrity of the original source tables and perform the join operation within a new, dedicated output table. This non-destructive approach is considered best practice for data modeling, allowing for easy rollback and auditing of transformation steps.
Step-by-Step Example: Setting Up the Data
To illustrate the Anti Join process, we will use a hypothetical dataset involving two tables related to basketball player statistics. Suppose we have the first table, named data1, which contains essential information such as the Player’s Team Name and their Points Scored for various games. This table will serve as our primary, or ‘Left,’ table in the merge operation, meaning we want to find rows from this table that lack a match elsewhere.

We introduce a second table, named data2, which contains information on Team Name and Rebounds recorded. Our goal is to use this second table (the ‘Right’ table) as the exclusionary list. Specifically, we want to find all rows in data1 that correspond to teams that are not present in data2. This would allow us to identify teams with score data but missing rebound data, potentially highlighting a gap in data collection.

The objective is precise: we aim to perform an anti join where we strictly retain only those rows originating from the data1 table that do not have corresponding matching values in the Team column of the data2 table. This operation effectively filters data1 based on the absence of information in data2, yielding a focused subset for analysis.
Executing the Merge Queries Operation
The execution phase begins once the data is loaded and the objective is clear. Starting from the Power BI Desktop, initiate the process by clicking the Home tab along the top ribbon, followed by clicking the Transform data icon, which opens the Power Query Editor. Inside the editor, select the Merge Queries icon, which is located in the Combine group, and choose Merge Queries as New from the subsequent dropdown menu to start the configuration of the new table.
In the resulting Merge dialog box, the first step is to select the primary table, data1, from the top dropdown menu (designating it as the Left table), and data2 from the bottom dropdown menu (designating it as the Right table). Next, the critical step is defining the join key: click the header for the Team column in both tables. This tells Power BI to use the values in these linked columns as the basis for the comparison and matching logic, ensuring the join performs accurately across the common field.

Crucially, within the merge dialog, locate the “Join Kind” dropdown menu and select the Left Anti (rows only in first) option. This selection formalizes the Anti Join request. The visualization preview within the dialog box will dynamically update to show an estimate of the number of rows that will be returned, corresponding only to the unmatched records from the data1 table. Once these parameters are confirmed, clicking OK executes the core Anti Join logic.

The resulting temporary table will immediately show the rows from data1 that did not find a match in data2, with the entire data2 table information collapsed into a single column named “data2.”
Refining and Finalizing the Anti Join Result
After the initial merge is performed, the output table, tentatively named ‘Merge1,’ will contain the rows from data1 that met the exclusion criteria. The final column, corresponding to the merged table data2, will appear as a structured value column. Since the core purpose of the Anti Join is exclusion, the values in this merged column are technically irrelevant, but they must be managed to finalize the dataset structure.
To properly format the output, click the expand icon (the left and right arrows) on the header of the data2 column. In the expansion menu that appears, you will typically want to deselect all columns since the rows returned by an Anti Join inherently have null or missing values from the right side. For visual confirmation, we can choose to include a column like Rebounds, whose values will be explicitly null for all returned rows, confirming the lack of a match.

Once you click OK after expanding (or choosing not to expand) the columns, the Anti Join is visually finalized, displaying only the records from the left table (data1) that failed to find a pair in the right table (data2). These records represent the distinct outliers or exceptions we set out to identify.

As illustrated, we see that only rows associated with the “Celtics” and “Magic” teams remain. Reviewing the initial tables confirms that these two teams were present in data1 but were absent from data2, validating the successful execution of the Merge Queries operation using the Left Anti configuration. The resulting table is clean, concise, and focused solely on the required non-matching data points.
Post-Processing and Deployment in Power BI
The final steps involve integrating the new, merged table back into the Power BI data model for visualization and reporting. After closing the Power Query Editor window, a message box will prompt the user, asking whether they wish to apply the pending transformations and load the new data. Confirming this step by clicking Yes executes the changes and materializes the new table, typically named “Merge1,” within the Power BI Desktop environment.
You can then navigate to the Table view within Power BI Desktop to inspect the newly created table, confirming that it contains the expected structure and the precise subset of data—specifically, the rows from the primary table that lacked matches in the lookup table. This table is now ready for use in reports, visualizations, and further analytical processing.

A minor but important cleanup step involves column renaming. If any residual columns from the merged table (like data2.Rebounds) were included and now display nulls, it is good practice to remove them or, if they are retained for clarity, rename them. For example, you can right-click on the header named data2.Rebounds within the Power Query Editor and simplify the column name to just Rebounds, even if all values are null. This ensures the final deployed table adheres to clean data naming conventions.

The resulting table, Merge1, now serves as the authoritative list of records from data1 that had no relationship defined by the Team column in data2. This principle of exclusion is the defining feature of the Anti Join, providing immediate focus on the exceptions.

Notice that this final merged table contains all rows from the data1 table that did not have matching values in the Team column of the data2 table. Note: If you’d like, you can right click on the header named data2.Rebounds and rename the column to just Rebounds before applying the changes.
Conclusion and Best Practices for Data Merging
Mastering the Anti Join in Power BI provides analysts with a sophisticated tool for data quality management and critical segmentation. By using the “Left Anti” option within the Merge Queries interface, users can precisely isolate records that lack corresponding entries in a lookup table. This technique is far more efficient for exclusion purposes than attempting complex filtering on standard join results.
When implementing Anti Joins, always adhere to crucial best practices. Firstly, always use the Merge Queries as New option to avoid altering your original source data and to maintain a transparent audit trail of transformation steps. Secondly, be meticulously careful in defining the Left and Right tables; reversing them will yield a completely different and potentially misleading result set. Finally, ensure the join key columns are of compatible data types and contain clean, normalized values to guarantee accurate matching logic.
The ability to identify and analyze missing data or exceptions—whether it is identifying teams missing statistical data or customers who haven’t purchased—is a hallmark of advanced data analysis. Integrating the Anti Join into your Power BI workflow will significantly enhance your ability to perform deep, meaningful data diagnostics and deliver highly focused business intelligence.
The following tutorials explain how to perform other common tasks in Power BI:
Cite this article
mohammed looti (2026). How to Find Records Not in Another Table Using Power BI Anti Joins. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-to-perform-an-anti-join-in-power-bi-with-an-example/
mohammed looti. "How to Find Records Not in Another Table Using Power BI Anti Joins." PSYCHOLOGICAL SCALES, 9 Jan. 2026, https://scales.arabpsychology.com/stats/how-to-perform-an-anti-join-in-power-bi-with-an-example/.
mohammed looti. "How to Find Records Not in Another Table Using Power BI Anti Joins." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-to-perform-an-anti-join-in-power-bi-with-an-example/.
mohammed looti (2026) 'How to Find Records Not in Another Table Using Power BI Anti Joins', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-to-perform-an-anti-join-in-power-bi-with-an-example/.
[1] mohammed looti, "How to Find Records Not in Another Table Using Power BI Anti Joins," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, January, 2026.
mohammed looti. How to Find Records Not in Another Table Using Power BI Anti Joins. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.
