Average order value by customer tier with a table variable

Store the customers of a tier in a table variable once, then use it to filter both sales and order lines for an average order value per segment.

You will learn to

  • Keep a filtered table of customers in a variable
  • Reuse one table variable as a filter in two CALCULATEs
  • Calculate a ratio for a dynamic segment

How it works

Do Gold customers buy more often, or do they buy bigger things? Average order value per tier answers the second question: the tier’s sales divided by the tier’s order lines.

Both the numerator and the denominator need the **same** customers. Instead of writing the tier filter twice, store it once: a variable can hold a table, `VAR TierCustomers = FILTER(VALUES(Customer[Customer]), …)`, and every `CALCULATE(..., TierCustomers)` after it uses that list as a filter.

Watch the denominator. `[Order Lines]` on its own counts every order line in the period, because the tier table is disconnected; it has to be filtered by the tier’s customers too.

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

Units per Line in Price Band =
VAR BandProducts = FILTER(VALUES(Product[Product]), CALCULATE(MAX(Product[Price])) >= 100)
RETURN DIVIDE(CALCULATE([Total Quantity], BandProducts), CALCULATE([Order Lines], BandProducts))