Table.RemoveMatchingRows

Updated on

Table.RemoveMatchingRows is a Power Query M function that removes all occurrences of specified rows from a table. The function returns a new table with the matching rows removed, and can use an optional equationCriteria parameter for row comparison.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Table.RemoveMatchingRows(
   table as table,
   rows as list,
   optional equationCriteria as any,
) as table

Description

Table.RemoveMatchingRows removes all occurrences of specified rows from the table. An optional equationCriteria may be used for row comparison.

Examples

Remove any rows where [a = 1] from the table ( {[a = 1, b = 2], [a = 3, b = 4], [a = 1, b = 6]} ).

// Output: Table.FromRecords( {[a = 3, b = 4]} )
Table.RemoveMatchingRows( 
    Table.FromRecords( {
        [a = 1, b = 2],
        [a = 3, b = 4],
        [a = 1, b = 6]
    } ),
    {[a = 1]},
    "a"
 )

Learn more about Table.RemoveMatchingRows 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 functions related to Table.RemoveMatchingRows are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-removematchingrows