How filters flow in a star schema

Filters travel from a dimension table down to the fact table, never back up — use that to count products that did not sell.

You will learn to

  • Predict which tables a filter reaches
  • Explain why a dimension table ignores filters from other dimensions
  • Count from the fact table to follow every filter

How it works

Pedal & Co. is a **star schema**: one fact table, `Sales`, in the middle, and dimension tables (`Product`, `Customer`, `Date`) around it. Each relationship is **one-to-many** — one product appears on many sales.

Filters flow along a relationship from the **one** side to the **many** side. Pick March 2024 and the Date filter reaches Sales, so only March sales are visible. It does **not** continue up to Product: the Product table still shows all 12 products, because a filter can’t travel from Sales back to a dimension.

So the two kinds of count answer different questions. `COUNTROWS(Product)` counts the products in the catalog (only Product filters change it). `DISTINCTCOUNT(Sales[ProductKey])` counts the products that actually **sold**, and it follows every filter that reaches Sales.

Put them side by side and the gap between them is useful information.

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

Idle Customers = COUNTROWS(Customer) - DISTINCTCOUNT(Sales[CustomerKey])