List.Count

List

Returns the number of 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.Count(list as list) as number

Parameters

NameTypeRequiredDescription
listlistYesThe list to count.

Return Value

numberThe 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
13

Compatibility

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