List.Sum

Updated on

List.Sum is a Power Query M function that returns the sum of the non-null values in a list. The function returns the sum of the non-null values or null if there are no non-null values in the list.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

List.Sum(
   list as list,
   optional precision as nullable number,
) as any
Argument Attribute Description
list
precision optional The Precision.Type specifies the accuracy level for calculations. When omitting this argument, Power Query uses Precision.Double by default, which, while efficient, may cause rounding errors with very small fractions. For greater accuracy Precision.Decimal offers a more precise number representation, ideal for tasks requiring high precision.

Description

Returns the sum of the non-null values in the list, list. Returns null if there are no non-null values in the list.

Examples

Find the sum of the numbers in the list {1, 2, 3}.

// Output: 6
List.Sum( {1, 2, 3} )

Learn more about List.Sum in the following articles:

Other functions related to List.Sum are:

BI Gorilla Blog

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/list-sum