Table.ReplaceMatchingRows
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Replaces specific rows from a table with the new rows.
Table.ReplaceMatchingRows(table as table, replacements as list, optional equationCriteria as any) as table
| Argument | Description |
|---|---|
| table | The Table to modify. |
| replacements | The List of replacement rows. |
| optional equationCriteria | An optional value that specifies how to control comparison between the rows of the table. |
Table.ReplaceMatchingRows is similar to List.ReplaceMatchingRows but requires a table as input.
The new rows must be compatible with the type of the table .
Table.ReplaceMatchingRows(
Table.FromRecords(
{
[Column1 = 1, Column2 = 2],
[Column1 = 2, Column2 = 3],
[Column1 = 3, Column2 = 4],
[Column1 = 1, Column2 = 2]
}),{
{[Column1 = 1, Column2 = 2],
[Column1 = -1, Column2 = -2]},
{[Column1 = 2, Column2 = 3],
[Column1 = -2, Column2 = -3]} })
| Column1 | Column2 |
|---|---|
| -1 | -2 |
| -2 | -3 |
| 3 | 4 |
| -1 | -2 |
Show: