Table.ReplaceMatchingRows
Syntax
Table.ReplaceMatchingRows(table as table, replacements as list, optional equationCriteria as any) as table
About
Replaces all the specified rows in the table
with the provided ones. The rows to replace and the replacements are specified in replacements
, using {old, new} formatting. An optional equationCriteria
parameter may be specified to control comparison between the rows of the table.
Example 1
Replace the rows [a = 1, b = 2] and [a = 2, b = 3] with [a = -1, b = -2],[a = -2, b = -3] in the table.
Usage
Table.ReplaceMatchingRows(
Table.FromRecords({
[a = 1, b = 2],
[a = 2, b = 3],
[a = 3, b = 4],
[a = 1, b = 2]
}),
{
{[a = 1, b = 2], [a = -1, b = -2]},
{[a = 2, b = 3], [a = -2, b = -3]}
}
)
Output
Table.FromRecords({
[a = -1, b = -2],
[a = -2, b = -3],
[a = 3, b = 4],
[a = -1, b = -2]
})
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for