Syntax

COUNT(some-list)

Arguments

  • some-list (list of any type)

Return Value

Number: The count of items in some-list.

Examples

COUNT(Products[Color]) : The total number of non-blank, possibly duplicate values in the Color column of the Products table. Equivalent to COUNT(SELECT(Products[Color], TRUE, FALSE)). See also SELECT().

COUNT(SELECT(Products[Color], TRUE, TRUE)) : The total number of non-blank, non-duplicate values in the Color column of the Products table.

COUNT(SELECT(Products[Color], IN([Color], {"Red", "Orange"}))) : The total number of non-blank, possibly duplicate values in the Color column of the Products table where the Color column value is either Red or Orange. See also IN().

COUNT(Orders[_RowNumber]) : The total number of rows in the Orders table. Note that this is not equivalent to MAX(Orders[_RowNumber]), which doesn't account for empty (e.g., deleted) rows or a spreadsheet header row. See also MAX().

COUNT([Discounts]) : The count of the items in the Discounts column value, where Discounts is of type List.

COUNT(LIST("Red", "Yellow", "Green")) : 3

COUNT(LIST()) : 0

Potential Problems

COUNT(1, 2, 3) : The arguments are not in list form. To fix, wrap them in LIST() to construct a list: COUNT(LIST(1, 2, 3)).

See Also

AVERAGE(), MAX(), MIN(), STDEVP(), SUM()

Did this answer your question?