0
0
Power BIbi_tool~10 mins

COUNTROWS in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table lists products and their category. All products here belong to the 'Fruit' category.

CellValue
A1Product
A2Apple
A3Banana
A4Cherry
A5Date
B1Category
B2Fruit
B3Fruit
B4Fruit
B5Fruit
Formula Trace
COUNTROWS(FILTER(Table1, Table1[Category] = "Fruit"))
Step 1: FILTER(Table1, Table1[Category] = "Fruit")
Step 2: COUNTROWS(Table with rows [Apple, Banana, Cherry, Date])
Cell Reference Map
   A        B
1 Product  Category
2 Apple    Fruit  <-- included
3 Banana   Fruit  <-- included
4 Cherry   Fruit  <-- included
5 Date     Fruit  <-- included
The formula uses the Category column (B2:B5) to filter rows where the value is 'Fruit'. All rows from 2 to 5 are included.
Result
   A        B        C
1 Product  Category  Result
2 Apple    Fruit     4
The result 4 shows the count of rows where Category is 'Fruit'. It is placed in cell C2.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the FILTER function return in this formula?
AAll rows where Category is 'Fruit'
BOnly the first row
CRows where Product is 'Apple'
DNo rows
Key Result
COUNTROWS counts the number of rows in a table or filtered table.