DAX Aggregation - COUNTX function
Description
Counts the number of rows that contain a number or an expression that evaluates to a number, when evaluating an expression over a table.
Syntax
COUNTX (<table>, <expression>)
Parameters
Sr.No. | Parameter & Description |
---|---|
1 |
table The table containing the rows to be counted. |
2 |
expression An expression that returns the numbers you want to count. |
Return Value
Returns a whole number.
Remarks
The COUNTX function counts only numeric values or dates. Parameters that are logical values or text that cannot be translated into numbers are not counted.
If the function finds no rows to count, it returns a blank. When there are rows, but none meets the specified criteria, then the function returns 0.
Example
= COUNTX (RELATEDTABLE (East_Sales), IF ([Product] = East_Sales[Product],1,0))