DAX COUNTA function

Counts the rows where a column is not blank. It works on text, dates and numbers.

COUNTA tells you how many values a column actually holds. It is useful for checking how complete your data is, and for counting a column that has blanks.

Syntax

COUNTA(<column>)
ArgumentRequiredDescription
columnRequiredThe column whose non-blank values are counted.

Returns: A whole number, or blank if nothing was counted.

Examples

Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).

1. Sales rows with a country

Rows With Country = COUNTA(financials[Country])

Result: 700

All 700 rows have a country, so the result equals the number of rows.

2. Rows by segment

Rows With Country = COUNTA(financials[Country])
SegmentRows With Country
Channel Partners100
Enterprise100
Government300
Midmarket100
Small Business100
Total700

Each segment counts only its own rows, because the table visual filters the measure.

Try COUNTA yourself

Change the formula and run it on the 700-row practice data. Free, with no signup.

Want an exercise that checks your answer? Free DAX practice

Good to know

  • COUNTA counts duplicates. To count each value once, use DISTINCTCOUNT.
  • To count every row of a table, whether or not a column is blank, use COUNTROWS.

Related functions

Official reference: COUNTA function on Microsoft Learn