Cheat Sheets/Power BI/COUNTROWS
DAX function

COUNTROWSDAX function reference

Count rows in a table.

Syntax

dax
COUNTROWS(<table>)

Examples

dax
COUNTROWS(Sales)
A number
dax
COUNTROWS(FILTER(Sales, Sales[Amount] > 1000))
Count of large orders

A common alternative to DISTINCTCOUNT when you need the underlying table for other calculations too.

dax
COUNTROWS(VALUES(Sales[CustomerID]))
Distinct customer count

Common mistakes & gotchas

Related DAX functions

From Aggregations

Used in these tutorials

← Back to the Power BI (DAX) cheat sheet