How does the COUNTX function (DAX) work?
The COUNTX function (DAX) counts the number of rows that contain a non-blank value or an expression that evaluates to a non-blank value, when evaluating an expression over a table.
COUNTX Formula Syntax
How do you use the COUNTX function?
The COUNTX function is used to count only number values, dates, or strings.
Related Blog Posts
Related Support Forum Posts
Considerations when using the function
The COUNTX function takes two arguments. The first argument must always be a table, or any expression that returns a table. The second argument is the column or expression that is searched by COUNTX.
If the function finds no rows to count, it returns a blank.
Related Video Tutorials
Formula examples using the COUNTX function
= COUNTX (RELATEDTABLE (East_Sales), IF ([Product] = East_Sales[Product],1,0))
Related DAX Functions
Related Course Modules
To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.