List.Sum

List

Returns the sum of all items in a list.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

List.Sum(list as list, optional precision as nullable number) as any

Parameters

NameTypeRequiredDescription
listlistYesThe list of numbers to sum.
precisionnumberNoOptional precision type (e.g., Precision.Decimal or Precision.Double).

Return Value

anyThe sum of all numeric items in the list.

Remarks

List.Sum calculates the total of all numeric values in a list. Null values are ignored. This is commonly used inside Table.Group aggregations — for example, each List.Sum([Quantity]) to sum quantities per group.

Examples

Example 1: Sum all quantities

let
    Total = List.Sum(Table.Column(Sales, "Quantity"))
in
    #table({"TotalQuantity"}, {{Total}})
Result
TotalQuantity
135

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks