21. Dynamic Charts: Field Parameters, What-if and Dynamic Top N
21.1 Field Parameters: Switch Measures
Quick answer: the short, self-contained version of this lesson is the guide Power BI Field Parameters.
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
- Modeling › New parameter › Fields.
- Name
Metric; addTotal Sales,Total Orders,Avg Delivery Mins› tick Add slicer to this page › Create. - Create a bar chart: Y-axis
City, X-axis theMetricparameter field. - Set the slicer to Single select (Format › Slicer settings).
- Pick each metric in turn.
Show the result
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.
Field parameters to switch measures in Power BI with example — 30 सेकंदात
काय: Field parameter म्हणजे measures (किंवा columns) चा छोटा table. त्यावरचा slicer user ला chart काय दाखवतो ते बदलू देतो.
का: Manager ना एकच chart आणि एक पर्याय हवाय: Sales, Orders की AOV. तीन charts ची गरज नाही.
छोटं उदाहरण: Slicer = Orders, then chart Pune 3, Mumbai 2, Nashik 1 दाखवतो.
Field parameters to switch measures in Power BI with example — 30 सेकंड में
क्या: Field parameter measures (या columns) की एक छोटी table है. उस पर लगा slicer user को chart में क्या दिखे, यह बदलने देता है.
क्यों: Manager को एक ही chart और एक विकल्प चाहिए: Sales, Orders या AOV. तीन charts की ज़रूरत नहीं.
छोटा उदाहरण: Slicer = Orders, then chart Pune 3, Mumbai 2, Nashik 1 दिखाता है.
First look at the data (before, then after):
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:
- Click Modeling › New parameter › Fields.
- Name it Metric. Add Total Sales, Total Orders and AOV. Keep Add slicer to this page ticked. Click Create.
- Add a column chart. X-axis = City. Y-axis = Metric (the parameter, not a measure).
- Select the slicer. Turn on Single select.
- Click Orders. Check: 3, 2 and 1.
- Check that the axis title changes with the choice.
एक-एक step करून बघा:
- Modeling › New parameter › Fields वर click करा.
- नाव Metric द्या. Total Sales, Total Orders आणि AOV जोडा. Add slicer to this page tick ठेवा. Create वर click करा.
- एक column chart टाका. X-axis = City. Y-axis = Metric (parameter, measure नाही).
- Slicer निवडा. Single select चालू करा.
- Orders वर click करा. तपासा: 3, 2 आणि 1.
- Axis title निवडीप्रमाणे बदलतो ना ते तपासा.
एक-एक step करके देखिए:
- Modeling › New parameter › Fields पर click कीजिए.
- नाम Metric रखिए. Total Sales, Total Orders और AOV जोड़िए. Add slicer to this page tick रखिए. Create पर click कीजिए.
- एक column chart लगाइए. X-axis = City. Y-axis = Metric (parameter, measure नहीं).
- Slicer चुनिए. Single select चालू कीजिए.
- Orders पर click कीजिए. जाँचिए: 3, 2 और 1.
- Axis title चुनाव के साथ बदलता है या नहीं, जाँचिए.
Steps in Power BI
- Modeling › New parameter › Fields.
- Name:
Metric Selector. - In Add and reorder fields, tick
[Total Sales],[Total Orders],[AOV],[Avg Delivery Time (mins)]. Drag to reorder. - Keep Add slicer to this page ticked › Create.
- 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). - Select "Avg Delivery Time (mins)" in the slicer. The chart switches measure, and its axis title changes automatically.
- 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.
Ravindra Bagale's Tip – मराठी
Field parameter मधली एक common चूक म्हणजे format चेक न करता वेगवेगळ्या formats चे measures (₹ आणि %) एकाच axis वर घेणं. Measure tools मध्ये सगळे measures बरोबर format करून ठेवा, आणि parameter table मध्ये स्पष्ट display names वापरा. पुन्हा एकदा करून बघा, मग पुढे जा.
Ravindra Bagale's Tip – हिंदी
Field parameter की एक common गलती है format check किए बिना अलग-अलग formats के measures (₹ और %) एक ही axis पर रखना. Measure tools में सभी measures को सही format करके रखो, और parameter table में साफ़ display names इस्तेमाल करो. एक बार फिर करके देखो, फिर आगे बढ़ो.
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.
Revision card
Interview card