Dynamic segmentation: count customers per tier from a parameter table

Put customer tiers on the rows of a matrix with a disconnected tier table, and count how many customers fall between each tier’s minimum and maximum sales.

You will learn to

  • Read a band’s limits from a disconnected tier table with MIN and MAX
  • Count the customers whose sales fall inside the band
  • Leave out customers with no sales, because a blank passes a >= 0 test

How it works

A label measure can’t go on the rows of a visual, so “how many Gold customers do we have?” needs another approach: **dynamic segmentation**. The `'Customer Tier'` table lists the tiers with their limits: Bronze 0 to 2,500, Silver 2,500 to 5,000, Gold 5,000 to 10,000, Platinum 10,000 and up. It has no relationships, so it filters nothing. Put `Tier` on the rows and let the measure do the matching.

In the Gold row, `MIN('Customer Tier'[Min Sales])` is 5,000 and `MAX('Customer Tier'[Max Sales])` is 10,000. Walk the visible customers with `FILTER(VALUES(Customer[Customer]), …)` and keep the ones whose sales are at least the minimum and below the maximum. On the total row MIN and MAX span every tier, so the total counts each customer once. (SELECTEDVALUE would leave the total blank.)

One trap: a customer who bought nothing in the period has **blank** sales, and in DAX `BLANK() >= 0` is TRUE. Unless you exclude blanks, every inactive customer lands in Bronze. Here a customer with no sales is in no tier: store the sales in a variable inside FILTER and require `NOT ISBLANK(...)` as well.

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

Products in Price Band =
COUNTROWS(FILTER(VALUES(Product[Product]),
    VAR Price = CALCULATE(MAX(Product[Price]))
    RETURN Price >= 100 && Price < 500))