Table.RemoveMatchingRows

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

Removes all occurrences of the specified rows from the table. An optional parameter equationCriteria may be specified to control the comparison between the rows of the table.

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 Blog

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-removematchingrows
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.