List.Count
ListReturns the number of items in a list.
Syntax
List.Count(list as list) as numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list to count. |
Return Value
number — The number of items in the list.
Remarks
List.Count returns the total number of items in a list, including nulls. This is the list equivalent of Table.RowCount.
Examples
Example 1: Count distinct regions
let
Regions = List.Distinct(Table.Column(Sales, "Region")),
Count = List.Count(Regions)
in
#table({"DistinctRegions"}, {{Count}})Result
DistinctRegions | |
|---|---|
| 1 | 3 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks