COUNTAX

Updated on

COUNTAX is a DAX function that counts the number of values resulting from evaluating an expression for each row of a table.

Syntax

COUNTAX(
   Table,
   Expression
)
Argument Properties Description
Table The table containing the rows for which the expression will be evaluated.
Expression The expression to be evaluated for each row of the table.

Return Values

A whole number.

Remarks

  • Like the COUNTA function, the COUNTAX function counts cells containing any type of information, including other expressions. For example, if the column contains an expression that evaluates to an empty string, the COUNTAX function treats that result as non-blank. Usually the COUNTAX function does not count empty cells but in this case the cell contains a formula, so it is counted.

  • Whenever the function finds no rows to aggregate, the function returns a blank.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following example counts the number of nonblank rows in the column, Phone, using the table that results from filtering the Reseller table on [Status] = Active.

= COUNTAX(FILTER('Reseller',[Status]="Active"),[Phone])

Other functions related to COUNTAX are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/countax-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy