Power BI technique · built-in features only
How to let readers switch measures or axes with field parameters
By Nawaf Sharaf · Founder & Reliability Engineer · Updated
When to use it. Use field parameters when several measures share one chart (Revenue, Margin, Units) or several dimensions share one axis (Region, Product, Channel). They replace bookmark-based switching for this job.
Worked example
Worked example · Copperleaf Coffee · the Metric slicer drives one line chart
Metric = Revenue
Revenue by month
Jan · $182Kpeak $251KDec · $251K
Metric = Gross Margin %
Gross Margin % by month
Jan · 35%peak 41%Dec · 39%
Metric = Units
Units by month
Jan · 41,200peak 55,800Dec · 55,800
Copperleaf Coffee is a fictional roaster. One line chart, one Metric slicer, three states: Revenue, Gross Margin % and Units. Revenue peaks in December, the gift month. Gross margin peaks in July at 41% and is weakest in February at 35%: the summer cold-brew range carries a better margin than the winter blends. Units add up to 579,500 bags over the year.
Each state keeps its own number format because the format belongs to each measure, not to the visual. Revenue shows as currency in thousands, margin as a percentage and units as whole numbers, with no format work on the chart. The y-axis also rescales for each metric, which is what you want when the measures have different units.
The chart title follows the slicer through a title measure that reads the parameter's display column, so the reader never has to look at the slicer to know what the line means.
Steps
- 1
Create the parameter
Modeling → New parameter → Fields. Name it (for example Metric), add the measures in the order you want them listed, and keep 'Add slicer to this page' checked.
- 2
Use it in the visual
Drag the parameter field into the visual's Y-axis or Values well (for measures) or X-axis or Rows (for columns), replacing the original field.
- 3
Show the choice in the title
The parameter table has a display column; a title measure can read it so the chart says what it shows.
Title Metric = SELECTEDVALUE ( Metric[Metric], "Revenue" ) & " by month" - 4
Make the slicer single-select
In the slicer's Format → Slicer settings → Selection, turn on Single select so the chart never shows several measures by accident (unless you want that).
- 5
Order and rename
The parameter is a calculated table; edit its DAX to rename display labels or change the order value (the third argument of each tuple).
How it works
A field parameter is a calculated table that Desktop writes for you. Each row holds a display name, a reference to a field made with NAMEOF, and an order number. When a visual uses the parameter column, Power BI looks at which rows are selected in the slicer and swaps in the referenced fields at query time. Nothing is computed in DAX at report time; the substitution happens when the visual builds its query.
Because the parameter is an ordinary table, you can edit its DAX to rename a label, change the order number, or add a grouping column (for example Unit = "Currency" or "Percent") and use that column in a second slicer so readers only see comparable measures together.
The parameter does not create a measure. That is why it cannot be referenced inside other measures the way a measure can, and why each underlying measure still needs its own format string and description.
What Microsoft documents
Limits and behaviour from Microsoft Learn that change how you build this.
- Create the parameter from Modeling → New parameter → Fields. In the dialog you can drag fields to reorder them and double-click a field to change its display name; both choices end up in the DAX table, which you can edit later.
- Microsoft lists several limits that shape the design. Implicit measures can't be used, so an aggregated column needs an explicit measure first. AI visuals and Q&A don't work with field parameters. A reader can't choose "none": clearing the slicer selects every field. And a field parameter can't be the linked field of a drillthrough or tooltip page; link the individual fields it references instead.
- Against a live connection, a parameter needs a local model (DirectQuery for Power BI semantic models). The DAX for each row should have exactly three columns (name, NAMEOF reference, order); Microsoft warns that extra columns are unsupported and can give unexpected results.
- When several fields are selected, the order they appear in the visual follows the order the reader selected them, not the order number.
Variations
- Axis switching: build a second parameter of columns (Region, Channel, Product) and use it on the x-axis to let readers pivot the same chart.
- Allow multi-select on purpose for a comparison chart, and put the parameter in the legend so each selected measure gets its own line.
Check that it works
Click each slicer value in turn and check three things for each: the line redraws, the y-axis format matches the measure (currency, percent, count), and the title names the measure. Then select two values at once; if the visual is not meant for comparison, set the slicer to single select so this state can't happen.
Common mistakes
- Formats come from each measure; set the format string on every measure, not on the visual.
- Measures with different scales on one axis (revenue and margin %) mislead; group parameters by unit.
- Field parameters can't be used inside other measures as if they were a measure.
- Renaming a measure updates the NAMEOF reference automatically, but deleting one leaves a broken row in the parameter table; check the parameter after model clean-ups.
FAQ
Can one parameter mix measures and columns?
It can hold either; mixing them in one parameter rarely makes sense, because measures go into value wells and columns into axis or row wells.
Is this better than bookmarks?
For switching the field a visual uses, yes: one visual, no hidden duplicates, and it works with every filter. Bookmarks are still the tool for switching layouts or visual types.
Sources
Menu names follow Power BI Desktop as documented on Microsoft Learn; they can move between releases. The companies and figures in the worked example are invented.
Related
Assets and guides that go with this technique.