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>)| Argument | Required | Description |
|---|---|---|
| column | Required | The 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])| Segment | Rows With Country |
|---|---|
| Channel Partners | 100 |
| Enterprise | 100 |
| Government | 300 |
| Midmarket | 100 |
| Small Business | 100 |
| Total | 700 |
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