Forum Discussion
Create a filter with custom string values
- 3 years ago
create a new table called 'Selection_Options' with a single column, 'Options', with no relationships to other tables.
Make the data in the Options column like this:
Model1
Model2
Model3etc.
Then, for each column you'll have in your table visual, you'll have a measure like this:Column_1_Switch =VAR Selection =SELECTEDVALUE('Selection_Options'[Options], "All")RETURNSWITCH(TRUE(),Selection = "Model1", [Expression1],Selection = "Model2", [Expression2],Selection = "Model3", [Expression3]--etc.)
Alright. NOW, lastly, add a slicer to the page with your 'Selection_Options'[Options] column, and go to Visualizations> Format Visual> Visual> Slicer Settings> Single Select and turn Single Select ON!
Now, depending on what is selected in your slicer, each column can display a totally different measure.
You may have to have the same number of lines in each switch statement, one for each model. But that doesn't mean you can't have it return BLANK() if you want one model to have 4 columns and the other to have 3 etc.
The caveat is the columns headers will be the SAME in each model. So you may want to look into another solution if that is unacceptable to you.
create a new table called 'Selection_Options' with a single column, 'Options', with no relationships to other tables.
Make the data in the Options column like this:
Model1
Model2
Model3
etc.
Then, for each column you'll have in your table visual, you'll have a measure like this:
Alright. NOW, lastly, add a slicer to the page with your 'Selection_Options'[Options] column, and go to Visualizations> Format Visual> Visual> Slicer Settings> Single Select and turn Single Select ON!
Now, depending on what is selected in your slicer, each column can display a totally different measure.
You may have to have the same number of lines in each switch statement, one for each model. But that doesn't mean you can't have it return BLANK() if you want one model to have 4 columns and the other to have 3 etc.
The caveat is the columns headers will be the SAME in each model. So you may want to look into another solution if that is unacceptable to you.