Table.RemoveMatchingRows
The table without the rows equal to any of the rows you list.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.RemoveMatchingRows(table as table, rows as list, optional equationCriteria as any) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table to take rows out of. |
rows | list | The rows to take out, each as a record. |
equationCriteria | any optional | The columns that decide a match, as a name or a list of names. |
Returns
table. The other rows, in their order: every copy of a listed row is gone.
Remarks
- Give each row as a record with all of the table's columns, or name in equationCriteria the columns that count.
- For any other rule,
Table.SelectRowswith a condition does the work.
Examples
One row out
Table.RemoveMatchingRows(#table({"Shop", "Product"}, {{"Oslo", "Chair"}, {"Bergen", "Desk"}, {"Oslo", "Desk"}}), {[Shop = "Oslo", Product = "Desk"]})
| Shop | Product |
|---|---|
| Oslo | Chair |
| Bergen | Desk |
Every row of one shop out
Table.RemoveMatchingRows(#table({"Shop", "Product"}, {{"Oslo", "Chair"}, {"Bergen", "Desk"}, {"Oslo", "Desk"}}), {[Shop = "Oslo"]}, "Shop")
| Shop | Product |
|---|---|
| Bergen | Desk |
Related functions
Table.SelectMatchingRows, Table.SelectRows, Table.ReplaceMatchingRows, Table.Contains.