The COUNTROWS function counts the number of rows in the specified table, or in a table defined by an expression.
This function can be used to count the number of rows in a base table, but more often is used to count the number of rows that result from filtering a table, or applying context to a table.
Whenever there are no rows to aggregate, the function returns a blank. However, if there are rows, but none of them meet the specified criteria, the function returns 0. Microsoft Excel also returns a zero if no rows are found that meet the conditions.
Tutorial with example
In this tutorial we go through all the count functions. Below you can see the keynotes of the tutorial, so you can jump ahead to the one you need:
02:44 COUNT text (#ERROR), 03:24 COUNT numbers, 04:20 COUNT blanks, 04:56 COUNT dates
05:36 COUNTA text, 06:44 COUNTA numbers
12:34 COUNTROWS, 13:32 COUNTROWS with columns (#ERROR), 14:33 COUNTROWS with an expressionsion
Download example file:
Download the sample file here.