DAX Function Guide

COUNTAX
Empty image or helper icon

Sam McKay

CEO & Founder

How does the COUNTAX work?
The COUNTAX function counts nonblank results when evaluating the result of an expression.
COUNTAX Formula Syntax

COUNTAX(
     <table>,<expression>
)

How do you use the COUNTAX?

The COUNTAX function is used to iterate through rows in a table as well as to count rows where the expression is a non-blank result. It counts cells that contain any type of information, including other expressions.

If the column has an expression of an empty string, the COUNTAX function will treat it as non-blank. Usually, it won’t count empty cells but since the cell contains a formula, the function will count it.

Related Blog Posts

Loading

Considerations when using the COUNTAX?

The COUNTAX can be used on a Boolean data type. If there are no rows that produce a non-blank value, the function will return a blank result.

COUNTAX and COUNTX are identical except for Boolean. COUNTAX can operate on a Boolean data type, but COUNTX cannot do that.

Related Video Tutorials

Loading

Formula examples using the COUNTAX

=COUNTAX(FILTER(‘Reseller’,[Status]=”Active”),[Phone])

= COUNTAX ( FILTER (Results, Results[Season] = “Summer”), Results[Medal] )

= COUNTAX ( FILTER ( Orders, Orders[Customer ID] = EARLIER ( Orders[Customer ID] ) ), [Customer ID] )

Related Courses

Loading