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"
)
Related articles
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
Related functions
Other functions related to Table.RemoveMatchingRows are:
- Table.AlternateRows
- Table.Distinct
- Table.InsertRows
- Table.Range
- Table.RemoveFirstN
- Table.RemoveLastN
- Table.RemoveRows
- Table.Repeat
- Table.Skip
