List.ReplaceRange
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.
Returns a list that replaces count values in a list with a replaceWith list starting at an index.
List.ReplaceRange(list as list, index as number, count as number, replaceWith as list) as list
| Argument | Description |
|---|---|
| list | The List to modify. |
| index | The index to start at. |
| count | The number of values to replace. |
| replaceWith | The value to replace with. |
List.ReplaceRange({1, 2, 7, 8, 9, 5}, 2, 3, {3, 4}) equals {1, 2, 3, 4, 5}
Show: