List.Sum
ListReturns the sum of all items in a list.
Syntax
List.Sum(list as list, optional precision as nullable number) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list of numbers to sum. |
precision | number | No | Optional precision type (e.g., Precision.Decimal or Precision.Double). |
Return Value
any — The 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 | |
|---|---|
| 1 | 35 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks