DAX Aggregation - COUNTX function


Advertisements

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)) 
dax_functions_aggregation.htm

Useful Video Courses


Video

Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Abhay Gadiya

Video

Mastering DAX Studio

Featured

24 Lectures 2 hours

Randy Minder

Video

DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours

Randy Minder

Advertisements