Ravindra BagaleCourses & study guides मराठी Track your progress

21. Dynamic Charts: Field Parameters, What-if and Dynamic Top N

21.1 Field Parameters: Switch Measures

Start with a problem

Rani wants one chart where she can choose the metric herself – Total Sales, Total Orders or Avg Delivery Mins – instead of three separate charts.

Explain simply

A field parameter is a small table of fields (here measures). Put it in a slicer and in a visual; the slicer choice swaps which measure the visual shows.

Show the data

Metric Pune Nashik Kolhapur
Total Sales (₹) 850 800 450
Total Orders 3 3 2
Avg Delivery Mins 12.0 11.3 7.0

About this data: This table uses columns: Metric, Pune, Nashik, Kolhapur. This table uses columns: Slicer choice, Pune, Nashik, Kolhapur. This table uses columns: City, Total Sales, Total Orders, AOV. This table uses columns: Slicer choice, Chart shows (Pune · Mumbai · Nashik). Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).

Demonstrate

  1. Modeling › New parameter › Fields.
  2. Name Metric; add Total Sales, Total Orders, Avg Delivery Mins › tick Add slicer to this page › Create.
  3. Create a bar chart: Y-axis City, X-axis the Metric parameter field.
  4. Set the slicer to Single select (Format › Slicer settings).
  5. Pick each metric in turn.

Show the result

Field parameter slicer switching the measure, sample layout with fictional data

Your result should look like this (fictional sample):

Slicer choice Pune Nashik Kolhapur
Total Sales ₹850 ₹800 ₹450
Total Orders 3 3 2
Avg Delivery Mins 12.0 11.3 7.0

Explain what happened

The parameter table holds references to the three measures. The visual shows whichever field(s) the slicer leaves selected.

Explore further

  • Use a dynamic title: SELECTEDVALUE(Metric[Metric], "Metric") & " by City".

Detailed reference for this lesson:

Field parameters to switch measures in Power BI with example — in 30 seconds

What: A field parameter is a small table of measures (or columns). A slicer on it lets the user switch what a chart shows.

Why: The manager wants one chart and a choice: Sales, Orders or AOV. No need for three charts.

Tiny example: Slicer = Orders, then the chart shows Pune 3, Mumbai 2, Nashik 1.

First look at the data (before, then after):

Field parameters to switch measures in Power BI with example: before and after tables, fictional Blinkit Maharashtra data

Same before / after tables as text

Before — Three measures by city (practice data)

City Total Sales Total Orders AOV
Pune ₹600 3 ₹300
Mumbai ₹1,100 2 ₹550
Nashik ₹300 1 ₹300

Formula / click path

Modeling › New parameter › Fields, then creates a table like:
Metric = { ("Sales", NAMEOF('Orders'[Total Sales]), 0),
           ("Orders", NAMEOF('Orders'[Total Orders]), 1),
           ("AOV", NAMEOF('Orders'[AOV]), 2) }

After — One chart, three choices

Slicer choice Chart shows (Pune · Mumbai · Nashik)
Sales ₹600 · ₹1,100 · ₹300
Orders 3 · 2 · 1
AOV ₹300 · ₹550 · ₹300

Do it step by step:

  1. Click Modeling › New parameter › Fields.
  2. Name it Metric. Add Total Sales, Total Orders and AOV. Keep Add slicer to this page ticked. Click Create.
  3. Add a column chart. X-axis = City. Y-axis = Metric (the parameter, not a measure).
  4. Select the slicer. Turn on Single select.
  5. Click Orders. Check: 3, 2 and 1.
  6. Check that the axis title changes with the choice.

Steps in Power BI

  1. Modeling › New parameter › Fields.
  2. Name: Metric Selector.
  3. In Add and reorder fields, tick [Total Sales], [Total Orders], [AOV], [Avg Delivery Time (mins)]. Drag to reorder.
  4. Keep Add slicer to this page ticked › Create.
  5. Power BI creates a calculated table Metric Selector and a slicer. Build a line chart: X-axis = 'Date'[Date], Y-axis = Metric Selector (the parameter field).
  6. Select "Avg Delivery Time (mins)" in the slicer. The chart switches measure, and its axis title changes automatically.
  7. Slicer settings › Selection › Single select On, so one metric is shown at a time. The new button slicer style looks like tabs.

The generated DAX (you can edit the display names in the first argument):

Metric Selector = {
    ("Sales (₹)",          NAMEOF('_Measures'[Total Sales]),              0),
    ("Orders",             NAMEOF('_Measures'[Total Orders]),             1),
    ("AOV (₹)",            NAMEOF('_Measures'[AOV]),                      2),
    ("Avg Delivery (min)", NAMEOF('_Measures'[Avg Delivery Time (mins)]), 3)
}

Field parameters ha navin aani khup upyogi feature aahe. Ekda vaparla ki SWITCH method visraal.

Ravindra Bagale's Tip

A common field-parameter mistake is including measures with different formats (₹ and %) on one axis without checking the format. Keep all measures formatted correctly in Measure tools, and use clear display names in the parameter table. Try it once more, then move on.

Fix common mistakes

Wrong result Reason Correction
Chart shows three bars per city Slicer allows multi-select Single select
Axis format wrong after switching Measures have different formats Format each measure; axis follows the measure
Parameter missing in old file Older Desktop Update Desktop

Practise independently

Practice task

Select Total Orders. Which city is lowest?

Hints
  • Kolhapur has two orders.
Solution

Kolhapur with 2 orders (Pune and Nashik have 3 each).

Think like a professional

Field parameters replace many duplicate visuals and are easy to maintain. A strong portfolio feature.

Ravi Sir's Cards for this lesson

मराठी cards