DAX Function Guide

COUNTX
Empty image or helper icon

Sam McKay

CEO & Founder

How does the COUNTX work?
The COUNTX function (DAX) is a statistical function that counts the number of rows with a non-blank value when evaluating an expression on a table.
COUNTX Formula Syntax

COUNTX(
     ,
)

How do you use the COUNTX?

This function is used to count a number of rows that are not blank and returns a whole number. It is used to count only number values, dates, or strings.

Related Blog Posts

Loading

Considerations when using the COUNTX?

The COUNTX function counts only numerical values or dates. Values that are logical or in text that cannot be translated into numbers are not counted. If there are no rows to count, it returns a blank. If there are rows but none meets the criteria, then the function returns 0.

Related Video Tutorials

Loading

Formula examples using the COUNTX

=COUNTX(Product,[ListPrice])

=COUNTX(FILTER(Product,RELATED(ProductSubcategory[EnglishProductSubcategoryName])=”Caps”, Product[ListPrice])

= COUNTX (RELATEDTABLE (East_Sales), IF ([Product] = East_Sales[Product],1,0))

Related Courses

Loading