Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to find out which are rows not in A table to compare table B

Hi Team,

 

I have two table A and B table , how we can find out which are rows not in A table to compare table B

which join we can use?

 

Table ATable B
IDID
500 Rows1000 Rows
1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Table.RemoveMatchingRows(TableB, Table.ToRecords(TableA))

View solution in original post

5 REPLIES 5
AlienSx
Super User
Super User

Table.RemoveMatchingRows(TableB, Table.ToRecords(TableA))
shafiz_p
Super User
Super User

@Anonymous  You could also use Table.Join and Join Kind Right Anti(All rows from right table not in left table). By using Table.Join you don't need to provide merge column name. All column will be expand automatically. You can also use Table.SelectColumns to select only columns you want for your report with MissingField.UseNull parameter, which help you to prevent failure report refresh if source column name change some how. You can say it's a safety guard.

 

Note: Join operation cannot result in a table with duplicate column names


Syntex are given below :

let
Table1 = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Table2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],


//Join Kind - Right Anti select all rows from right table which are not in left table
//To, create a merge column, Table.NestedJoin could be used
//Since all rows or columns from first table is null, avoided nested join

MargedTbl1andTbl2 = Table.Join(Table1, "ID", Table2, "ID1",JoinKind.RightAnti),


//Selecting all the colums needed for the report, safety gaurd MissingField.UseNull
SelectColumns = Table.SelectColumns(MargedTbl1andTbl2, {"ID", "V2"},MissingField.UseNull)


in
SelectColumns


Now you have both the solution. Hope this help!!

Keezz
Helper I
Helper I

left ant merge

 

Keezz_0-1720446873241.png

 

aduguid
Super User
Super User

Try this in power query 

let
    TableA = Excel.CurrentWorkbook(){[Name="TableA"]}[Content],
    TableB = Excel.CurrentWorkbook(){[Name="TableB"]}[Content],
    MergedTables = Table.NestedJoin(TableB, {"ID"}, TableA, {"ID"}, "TableA", JoinKind.LeftAnti),
    FilteredRows = Table.SelectRows(MergedTables, each [TableA] = null)
in
    FilteredRows

Filtering the rows is not needed...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors
Top Kudoed Authors