Forum Discussion
How to Create Nested Field Parameters in Power BI Matrix (Show Columns Dynamically Based on Slicer)
Hi everyone,
I have created a Matrix visual in Power BI that includes around 10–12 columns.
To manage these columns dynamically, I used a Field Parameter so that I can easily show/hide or rearrange columns using a slicer.
Now, among these columns, I have two columns — `Old City` and `New City`.
I want to create an additional slicer with two options — Old and New.
Here’s what I want to achieve:
* If a user selects Old, the matrix should display the Old City column.
* If a user selects New, the matrix should display the New City column.
* Other columns (managed by the existing Field Parameter slicer) should still be rearrangeable and selectable as before.
Essentially, I want to create something like a nested field parameter, where one slicer controls which “version” of a field is shown (Old vs New), and the other controls which columns appear in the matrix.
Is there any way to implement this setup (maybe with DAX or an advanced parameter technique)?
Thanks in advance!
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
22 Replies
- GrowthNativesSuper User
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 ColumnsInstead 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 ParameterOpen 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 VisualAdd 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 UsabilityRename [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.
⚙️ WorkingThe 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]- Mahendra_kHelper I
Thank you for your detailed reply. I tried following your steps, but unfortunately it didn’t work.
- You already have a Field Parameter that dynamically controls columns in a Matrix.
- lucadelicioImpactful Individual
Hi Mahendra_k
download the attachment and see if it is what you need.
Mark as a solution if it help you.- Mahendra_kHelper I
Thank you for your answer, but I think there was a misunderstanding. This isn’t exactly what I was looking for.
- KarinSzilagyiSuper User
Hi Mahendra_k, if I understood your request correctly you just need to add additional columns to your Field Parameter:
To do so you just have to add a comma at the end of each row in the Field Parameter definition before the closing bracket and type whatever category you want to assign it to. You can add as many columns as you need like this to create a hierarchy. The important note is just that all rows need to have the same amount of columns at the end.
- Mahendra_kHelper I
Thank you for your answer, but I think there was a misunderstanding. This isn’t exactly what I was looking for.
- KarinSzilagyiSuper User
Hi Mahendra_k If I understood correctly, you want to use some static columns + some columns that would switch based on your selection. You can do that with my solution above too since you can combine the dynamic columns in the field parameter with the static columns directly from the tables you want to use:
If I select "Table B" the columns FieldDate, PlannedCompletionDate, CreatedDate, StatusOriginal and Year-Quarter stay static and can be feely moved around as needed, while the column "CreatedDate" is added dynamically from the Field-Parameter:When I switch to "Table A" the columns FieldDate, PlannedCompletionDate, CreatedDate, StatusOriginal and Year-Quarter are still static, "CreatedDate" disappears and "Sort" + "Status" are added instead of "CreatedDate" from the Field-Parameter:
Here you can see it in action:
Was this what you were looking for?
- danextianSuper User
Hi Mahendra_k
You can actually create a conditional calculated column in the field parameters table. You should able to use this calc column in a slicer. Note: this column cannot be used to create a hierachy in any other visuals.
- Poojara_D12Super User
Hi Mahendra_k
Yes, this can be done, but not with a single native field parameter, since Power BI currently doesn’t support nested or conditional field parameters out of the box. However, you can achieve the desired behavior by combining your existing field parameter with a supporting DAX measure or by creating a secondary parameter table to control the Old vs. New column dynamically. The idea is to have your original field parameter continue managing the selection and arrangement of the majority of columns, while introducing a second slicer that determines whether the “City” column in the matrix represents Old City or New City.
One clean way to do this is to replace the Old City and New City fields in the parameter with a single “City” placeholder, and then use a DAX measure (or calculated column) that switches between Old City and New City values based on the slicer selection. For example, you can create a disconnected table with two rows: “Old” and “New,” use it as a slicer, and then define a DAX measure like:
Selected City = VAR _sel = SELECTEDVALUE(CityToggle[Type]) RETURN SWITCH( _sel, "Old", SELECTEDVALUE(Table[Old City]), "New", SELECTEDVALUE(Table[New City]) )Then, in your field parameter table, remove the original Old City and New City fields, and add this new Selected City measure as one of the parameter fields. This way, when users toggle between Old and New, the “City” column in the matrix dynamically reflects the correct field, while the existing field parameter slicer continues to control the visibility and order of other columns independently.
Alternatively, if you want more flexibility, you could use two field parameter tables — one for the version selection and one for the general columns — and then use a matrix with measures or a composite field parameter (by UNION-ing the parameter tables) to combine both behaviors, though that’s more advanced and harder to maintain. The first approach — using a toggle slicer plus a DAX measure in the parameter — is generally the simplest and most robust way to achieve this nested control.
- v-menakakotaCommunity Support
Hi Mahendra_k ,
Thanks for reaching out to the Microsoft fabric community forum.Can you please confirm whether the issue is sorted or not.
Thank you.
- Mahendra_kHelper I
Thank you for following up. The issue is not yet resolved. Please let me know if you need any additional details from my side to help investigate further.
- Mahendra_kHelper I
The issue is not yet resolved. GrowthNatives already suggested this approach, but unfortunately, it didn’t solve the problem. Please let me know if you need any additional details from my side.
- v-menakakotaCommunity Support
Hi Mahendra_k ,
Since the issue is still not resolved, could you please help with a few more details, Could you share a screenshot of your field parameter setup and slicer?
Best Regards,
Community Support Team.