Forum Discussion
How to Switch Between Multiple Full Tables (Different Structures) Using a Dropdown Slicer + One Butt
- 4 months ago
You can do this with a bit of a tweak to field parameters. First create a field parameter which includes all the columns and measures you want to include across all configurations. Then add a new column to the field parameter table by editing the DAX, and assign each column or measure to a category, e.g. "Most Runs", Most Ducks". Rename the column to Category, not Value4.
You can have the same column in multiple categories by repeating the line for that column / measure with a different ordinal and category.
Put the field parameter into a table visual, and add a slicer using the category field. Changing the slicer selection changes the columns shown in the visual.
You can see an example below
Hi johnt75,
Thank you so much! I've been trying to solve this for days, and your solution finally worked perfectly.
The dropdown slicer now switches between tables correctly. However, I have one small issue:
When I select "Most Runs" in the slicer, I want the table to be sorted by Runs descending (highest runs first). But currently, it always shows in Player name order.
How can I make the table default to sorting by Runs descending for the "Most Runs" category?
Thanks again for your help.
I think that you can leave Player out of the field parameter, and just add it to the visual on its own, along with the field parameter. Adjust the Parameter Order value in the field parameter table so that the value you want to sort by is always in the first position within its category, and then sort the table / matrix visual by the first column in descending order. When you switch to another category I think it will still be sorted by whatever value is now in the first position.