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  

ArgumentDescription
listThe List to modify.
indexThe index to start at.
countThe number of values to replace.
replaceWithThe value to replace with.
List.ReplaceRange({1, 2, 7, 8, 9, 5}, 2, 3, {3, 4}) equals {1, 2, 3, 4, 5}  

Show: