Label customers Gold, Silver or Bronze by lifetime sales with SWITCH(TRUE())

Give every customer a tier label based on their all-time spend, so the label stays the same whichever year the report is filtered to.

You will learn to

  • Classify customers with SWITCH(TRUE(), …)
  • Base a label on lifetime sales by removing the date filter
  • Store a value once in a variable and test it several times

How it works

A **customer tier** is a label such as Gold, Silver or Bronze that sums up how valuable a customer is. Sales teams use it to decide who gets a call, a discount or a thank-you note.

The tier should describe the whole relationship, not one slice of it. If the report is filtered to 2025, a plain `[Total Sales]` only sees 2025, and a loyal customer who had a quiet year would drop a tier. Evaluate the sales with the dates cleared instead: `CALCULATE([Total Sales], REMOVEFILTERS('Date'))` is the customer’s **lifetime** spend, whatever the slicer says.

Store that number in a variable, then test it with `SWITCH(TRUE(), …)` from the strictest condition down. The first true test wins, and the last value is the fallback.

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

Lifetime Size =
VAR LifetimeUnits = CALCULATE([Total Quantity], REMOVEFILTERS('Date'))
RETURN SWITCH(TRUE(), LifetimeUnits >= 60, "Large", LifetimeUnits >= 30, "Medium", "Small")