Forum Discussion
Field Parameters for table columns: but using groups so I can swap out sets of columns all at once?
I have field parameters that let a user add or remove fields from a table dynamically which is great, but users tend to want to same 4 fields added or swapped all at once.
For example:
Country, State, City, Local Office
OR
They may want:
Region, Branch, Manager, Sales Agent
The point being I want them to be able to swap out those 4 columns all at once so they can change out a display between those two options (geographical vs sales region).
Is there a way to do this using Data groups?
I tried using field parameters but all it seems to do is just bundle those 4 options together as one field, I want to add 4 columns with the click of a single button.
Hey, sasdfasdfsad ,
you can do that easily just expanding the Field Parameters with group:
Go to the definitions of your Field Parameter (the table) and add one more column for each row with your group, and add additional fields as well, so you have stuff to choose from.
fields = { ("Country", NAMEOF('data'[Country]), 0, "Location Group"), ("State", NAMEOF('data'[State]), 1, "Location Group"), ("City", NAMEOF('data'[City]), 2, "Location Group"), ("Local Office", NAMEOF('data'[Local Office]), 3, "Location Group"), ("Region", NAMEOF('data'[Region]), 4, "Sales Org Group"), ("Branch", NAMEOF('data'[Branch]), 5, "Sales Org Group"), ("Manager", NAMEOF('data'[Manager]), 6, "Sales Org Group"), ("Sales Agent", NAMEOF('data'[Sales Agent]), 7, "Sales Org Group"), ("Product Category", NAMEOF('data'[Product Category]), 8, "Random Group"), ("Color", NAMEOF('data'[Color]), 9, "Random Group"), ("Size", NAMEOF('data'[Size]), 10, "Random Group") }The new column will be created automatically and will be called 'value4', if you wannt rename it, go to TableView/DataView of the field parameter table and rename it.
Also attaching file, so you can try it yourself.
1 Reply
- vojtechsima
Super User
Hey, sasdfasdfsad ,
you can do that easily just expanding the Field Parameters with group:
Go to the definitions of your Field Parameter (the table) and add one more column for each row with your group, and add additional fields as well, so you have stuff to choose from.
fields = { ("Country", NAMEOF('data'[Country]), 0, "Location Group"), ("State", NAMEOF('data'[State]), 1, "Location Group"), ("City", NAMEOF('data'[City]), 2, "Location Group"), ("Local Office", NAMEOF('data'[Local Office]), 3, "Location Group"), ("Region", NAMEOF('data'[Region]), 4, "Sales Org Group"), ("Branch", NAMEOF('data'[Branch]), 5, "Sales Org Group"), ("Manager", NAMEOF('data'[Manager]), 6, "Sales Org Group"), ("Sales Agent", NAMEOF('data'[Sales Agent]), 7, "Sales Org Group"), ("Product Category", NAMEOF('data'[Product Category]), 8, "Random Group"), ("Color", NAMEOF('data'[Color]), 9, "Random Group"), ("Size", NAMEOF('data'[Size]), 10, "Random Group") }The new column will be created automatically and will be called 'value4', if you wannt rename it, go to TableView/DataView of the field parameter table and rename it.
Also attaching file, so you can try it yourself.