Count order lines by region with COUNTROWS

Count how many sales were made in each region with COUNTROWS, and see why you count the Sales table rather than the Customer table.

You will learn to

  • Count the rows of a table with COUNTROWS
  • Choose the fact table when you want to count activity
  • Tell counting rows apart from adding up a quantity

How it works

Not every question is about dollars. “How many sales did we make?” is a **count**, and `COUNTROWS(table)` answers it: it counts the rows of a table that are visible under the current filters.

Which table you count matters:

- Count **Sales** and you count activity. Each row of Sales is one **order line**, so the count follows the month, product or region you filter by. - Count a lookup table such as **Customer** or **Product** and you count the list itself. The Customer table holds 10 customers per region whether they bought anything or not.

A count of rows is also not the same as a count of items. One order line can be for four water bottles; it is still one row. To add up the items you would use `SUM` on the Quantity column instead.

Practice it hands-on with a real data model and a live report that updates as you type.

Product Count = COUNTROWS(Product)