Count unique customers with DISTINCTCOUNT

Count how many different customers bought something — not how many orders they placed — with DISTINCTCOUNT.

You will learn to

  • Tell counting rows apart from counting unique values
  • Count unique values with DISTINCTCOUNT
  • Choose the fact table column so the count follows the report’s filters

How it works

“How many customers bought in March?” sounds like a count, but which count? `COUNTROWS(Sales)` counts **order lines** — a customer who ordered five times is counted five times.

`DISTINCTCOUNT(column)` counts each **different** value once. Pointed at a key column such as the product number on each sale, it tells you how many **different** products sold — the same idea works for any key.

Notice we count the key in **Sales**, not in the Customer table. Sales is where the buying happens, so it follows the month, product or region you filter by. The Customer table always lists all 40 customers, whether they bought that month or not.

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

Products Ordered = DISTINCTCOUNT(Sales[ProductKey])