OpenBI Docs Buy

COUNT

The number of a column's values that are not blank; a column of TRUE and FALSE is an error (use COUNTA).

Group: Aggregation. Compatible with DAX.

Syntax

COUNT ( <column> )
ParameterTypeDescription
columnColumnThe column whose values are counted.

Returns

Whole number. How many of the column's cells are not blank in the current filter context.

Remarks

  • Numbers, dates and text are counted alike; a column of TRUE and FALSE values is an error, for which COUNTA is meant.
  • When nothing is counted, the result is BLANK, not 0. Add 0 (COUNT ( ... ) + 0) where a zero should show.
  • To count the rows of a table, blanks or not, use COUNTROWS; to count the different values, DISTINCTCOUNT.

Examples

Holdings with a price

Two of the five holdings have no quoted price.

EVALUATE
ROW (
    "With a price", COUNT ( Holdings[Price] ),
    "Holdings", COUNTROWS ( Holdings )
)
With a priceHoldings
35

A text column counts too

EVALUATE
ROW ( "Products", COUNT ( Products[Product] ) )
Products
4

COUNTA, COUNTX, COUNTROWS, COUNTBLANK, DISTINCTCOUNT.

Last updated · OpenBI Studio 0.3.74