Buckets turn a number into a few readable groups: order size bands, age groups, delivery delays. In QuickSight a bucket is an ifelse with one range per group. The details that make it right are the order of the conditions and labels that sort properly.

Copy and paste

Bands of order value:

ifelse(
  {Sales} < 100,  '1. Under 100',
  {Sales} < 500,  '2. 100 to 499',
  {Sales} < 1000, '3. 500 to 999',
  '4. 1,000 and more'
)

Fixed-width bins of 250 (0, 250, 500, …):

floor({Sales} / 250) * 250

A missing value as a bucket of its own:

ifelse(
  isNull({Sales}), '0. No value',
  {Sales} < 100,   '1. Under 100',
  '2. 100 and more'
)

Example

The seven orders of this section fall into these bands:

Band Orders Sales
1. Under 100 1 50
2. 100 to 499 4 1,050
3. 500 to 999 2 1,400

No order reaches 1,000, so the last band does not appear. A visual only shows groups that have rows.

Write the ranges in one direction

ifelse returns the result of the first true condition. Listing the upper bounds from smallest to largest means each condition only needs its upper bound: an order of 300 fails < 100 and stops at < 500. Mixing directions, or using <= in one line and < in the next, is how values end up in two bands or in none.

Use < with the next band’s lower bound, so that 499.50 cannot slip between <= 499 and >= 500.

Labels that sort

Labels are text and sort alphabetically: 100 to 499 would come before Under 100. The number at the start of each label (1., 2., …) makes the alphabetical order the logical one. If you don’t want the numbers in the chart, create a second field with the same conditions returning 1, 2, 3, 4 and sort the visual by it.

Fixed-width bins

floor({Sales} / 250) * 250 returns the lower bound of each bin: 300 becomes 250, 900 becomes 750. It is a number, so the bins sort by themselves and every width is the same. For a quick distribution without a calculated field, the histogram visual also has built-in bin settings.

Buckets of totals, not rows

Both formulas classify single rows. “Customers who spent 1,000 or more in total” needs the total per customer before the bucket, and ifelse(sum({Sales}) >= 1000, ...) cannot be used as a dimension. The answer is a level-aware calculation: how to calculate a total per customer regardless of the visual.

Checked against the Amazon Quick Sight function reference (October 2026). The example results were recomputed in DuckDB.

References