List.Accumulate

Calculate a total value by combining the items in the list using an accumulator. You can also specify an initial value, known as the seed parameter, if needed.

Syntax

List.Accumulate(list as list, seed as any, accumulator as function) as any

About

Calculate a total value by combining the items in the list using an accumulator. You can also specify an initial value, known as the seed parameter, if needed.

Explanation

Calculates the total value by adding up the numbers in the list {1, 2, 3, 4, 5} following the formula (state + current). To perform this operation in Power Query MList, use the function MList.Accumulate({1, 2, 3, 4, 5}, 0, (state, current) => state + current). The result will be 15.