COUNTBLANK

Applies to: Calculated column Calculated table Measure Visual calculation

Counts the number of blank cells in a column.

Syntax

COUNTBLANK(<column>)

Parameters

Term Definition
column The column that contains the blank cells to be counted.

Return value

A whole number. If no rows are found that meet the condition, blanks are returned.

Remarks

  • The only argument allowed to this function is a column. You can use columns containing any type of data, but only blank cells are counted. Cells that have the value zero (0) are not counted, as zero is considered a numeric value and not a blank.

  • If there are no rows, or if there are rows but none of them is blank, the function returns a blank. COUNTBLANK never returns 0. This is different from Excel, which returns 0 when no cells are blank.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following example shows how to count the number of rows in the table Reseller that have blank values for BankName.

= COUNTBLANK(Reseller[BankName])

To count logical values or text, use the COUNTA or COUNTAX functions.