Average categories per customer with SUMMARIZE and COUNTROWS
Group the Sales table by customer and category with SUMMARIZE to count the combinations that really happened — a cross-sell breadth metric.
You will learn to
- Group a fact table by columns from related tables with SUMMARIZE
- Count the combinations that exist with COUNTROWS
- Turn the count into a per-customer average
How it works
`SUMMARIZE(Sales, Customer[Region], Product[Product])` walks the visible Sales rows and returns one row for each **combination that occurs**. The group-by columns can come from Sales itself or from any table it relates to.
That makes SUMMARIZE a great way to answer “how many pairs actually happened?”. A customer who only buys bikes appears once with Bikes; one who buys bikes and clothing appears twice. Combinations that never happened are simply not there.
Wrap the result in `COUNTROWS` to count the pairs. Because it starts from the visible Sales rows, the count follows every filter on the report: a quarter, a region, a year.
Practice it hands-on with a real data model and a live report that updates as you type.
Region-Product Pairs = COUNTROWS(SUMMARIZE(Sales, Customer[Region], Product[Product]))