Forum Discussion

sasdfasdfsad's avatar
sasdfasdfsad
Icon for Advocate IV rankAdvocate IV
5 months ago
Solved

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, S...
  • vojtechsima's avatar
    5 months ago

    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.