Instead of three charts for sales, profit and order count, build one chart and let the reader choose the metric from a dropdown. It takes a String parameter, a control and one calculated field.

Copy and paste

The metric field (String parameter Metric):

ifelse(
  ${Metric} = 'Sales',  sum({Sales}),
  ${Metric} = 'Profit', sum({Profit}),
  ${Metric} = 'Orders', intToDecimal(distinct_count({Order ID})),
  NULL
)

The dimension too (String parameter GroupBy):

ifelse(${GroupBy} = 'Region', {Region}, ${GroupBy} = 'Segment', {Segment}, {Customer})

Step by step

  1. Parameter: add a String parameter named Metric with the static default Sales.
  2. Control: from the parameter’s menu choose Add control, style Dropdown, and enter the values Sales, Profit and Orders as specific values, one per line. A fixed list makes typos impossible, and the text in the formula must match the values exactly, case included.
  3. Field: create the calculated field above and name it, for example, Selected metric.
  4. Visual: put Selected metric in the value well instead of the individual measures.
  5. Title: in the visual’s title, insert the parameter from the title editor’s menu, so that the chart reads “Sales by month” or “Orders by month”.

The AWS documentation shows the same pattern, with NULL as the final value. switch looks shorter for a list of equal-to tests, but its reference describes the results as fields, literals or scalar functions, not aggregations, so ifelse is the safer choice for measures.

One type for all branches

All results of an ifelse must have the same type. Sums of currency fields are decimals, and a count is an integer, so intToDecimal converts the count. If the editor accepts the mix without it, the conversion does no harm.

One format for all branches

The field has a single number format. Sales and profit want a currency, orders do not. Choose a neutral format (a number with thousands separators), or keep percentages and amounts in separate selectors. A metric that is a ratio, such as margin, mixed with amounts on the same axis would also make the axis meaningless.

Switching the dimension

The third formula lets the reader choose the grouping. All branches must be text fields, and the result is a dimension like any other. Sorting and colours follow the values, so a chart that is sorted by region name will sort by segment name after the switch.

Checked against the Amazon Quick Sight documentation (October 2026).

References