Forum Discussion
How to Create Nested Field Parameters in Power BI Matrix (Show Columns Dynamically Based on Slicer)
- 10 months ago
Hi Mahendra_k ,
Thank you for the update, I see what you’re trying to do. Right now, Power BI doesn’t let you change the field position dynamically in a Matrix when using field parameters. You can swap which fields show up, but their order stays fixed once you’ve placed them. The only way to get different arrangements would be to create separate parameter setups. Hopefully this becomes more flexible in a future update.
Best Regards,
Community Support Team
hi Mahendra_k ,
this is a fairly advanced Power BI modeling pattern. Let's discuss how you can implement nested field parameters (Old vs New + Dynamic column selection) step-by-step 👇
🎯 Goal
- You already have a Field Parameter that dynamically controls columns in a Matrix.
Now you want a second slicer (Old/New) that toggles between “Old City” and “New City” without breaking the main parameter’s functionality.
🧩 Steps
1. Create a City Version Table
Create a small disconnected table for the Old/New toggle:
CityVersion =
DATATABLE(
"City Version", STRING,
{
{"Old"},
{"New"}
}
)This will drive your “Old/New” slicer.
2. Create Two Measures for City Columns
Instead of directly using the columns (Old City, New City) in your field parameter, create measures that switch based on slicer selection.
Example:
Selected City =
VAR sel =
SELECTEDVALUE('CityVersion'[City Version])
RETURN
SWITCH(
TRUE(),
sel = "Old", MAX('YourTable'[Old City]),
sel = "New", MAX('YourTable'[New City]),
BLANK()
)This measure dynamically shows either Old or New City based on slicer selection.
3. Update Your Field Parameter
Open your existing Field Parameter table (it might look like this):
ColumnParameter =
{
("Sales", NAMEOF('YourTable'[Sales]), 0),
("Profit", NAMEOF('YourTable'[Profit]), 1),
("Old City", NAMEOF('YourTable'[Old City]), 2),
("New City", NAMEOF('YourTable'[New City]), 3)
}➡ Replace the two city entries with your [Selected City] measure instead:
ColumnParameter =
{
("Sales", NAMEOF('YourTable'[Sales]), 0),
("Profit", NAMEOF('YourTable'[Profit]), 1),
("City", NAMEOF([Selected City]), 2)
}
4. Build Your Visual
Add a Matrix visual.
Place the Field Parameter slicer (from your original parameter table).
Add the CityVersion slicer (Old/New).
Use the parameter field in your Matrix columns — it will now dynamically switch both:
Columns shown (via parameter slicer),
Old/New City (via CityVersion slicer).
5. (Optional) Improve Usability
Rename [Selected City] to “City (Dynamic)” for clarity.
In the slicer, set single select for CityVersion (to avoid conflicts).
You can add conditional formatting or tooltips to show which version is currently active.
⚙️ Working
The Field Parameter controls which fields/measures appear in the matrix.
The CityVersion slicer drives a measure that acts as a proxy for both city columns.
Because Field Parameters can include measures, this pattern allows you to “nest” dynamic logic inside them.
🧠 Key Insight
Power BI doesn’t yet support true nested field parameters, but you can simulate them by:
Replacing any column with a measure that responds to another slicer (as shown above).
This technique is widely used for “Old vs New”, “YTD vs MTD”, or “Current vs Previous” dynamic views.
⭐Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
🚀Let’s keep building smarter, data-driven solutions together!🚀 [Explore More]
Thank you for your detailed reply. I tried following your steps, but unfortunately it didn’t work.