DAX function
COUNTA — DAX function reference
Count non-blank values.
Syntax
dax
COUNTA(<column>)
Examples
dax
COUNTA(Sales[Notes])
→ A number
dax
CALCULATE(COUNTA(Sales[Notes]), Sales[Region] = "West")
→ Count of non-blank notes in the West region
COUNTA works on any data type, unlike COUNT which is numeric-only.
dax
COUNTA(Product[DiscontinuedDate])
→ Counts products that have been discontinued (date filled in)
Common mistakes & gotchas
- COUNTA counts any non-blank value regardless of type, unlike COUNT which is numeric-only — the two can return different totals on the same column.
- An empty string "" counts as non-blank for COUNTA, which trips people up when source data uses "" instead of a true null.
Related DAX functions
From Aggregations