Forum Discussion
dynamically changing the column display based on slicer selection..
Hi Sam09,
First, please set the data type of [Model] to whole number in your data table.
Second, as mentioned in above link, you should create an extra table (suppose it's 'SlicerTable') to list all slicer selections. In this scenario, selecton should be 2016, 2017, 2018.
Third, make sure this new created table is unrelated to data table.
Create measures and add them to visual.
Values in current Year =
CALCULATE (
COUNTAX (
FILTER (
'ProdData',
'ProdData'[Level] = "A1"
|| 'ProdData'[Level] = "A2"
|| 'ProdData'[Level] = "A3"
&& ProdData[Model] = SELECTEDVALUE ( SlicerTable[Year] )
),
'ProdData'[Level]
)
)
Values in previous Year =
CALCULATE (
COUNTAX (
FILTER (
'ProdData',
'ProdData'[Level] = "A1"
|| 'ProdData'[Level] = "A2"
|| 'ProdData'[Level] = "A3"
&& ProdData[Model]
= SELECTEDVALUE ( SlicerTable[Year] ) - 1
),
'ProdData'[Level]
)
)
Best regards,
Yuliana Gu
- Sam097 years agoFrequent Visitor
v-yulgu-msft - Thanks for the detailed explanation. It works as expected, but issue is i cannot create a new table to hold slicer values, as i'm getting the data using DirectQuery(should not change to import) mode which doesn't allow to create a new table. Can i use the existing table column(Model) in the slicer, but issue here is the Model has 2016,2017 and 2018 as values but in the slicer i just need to show 2017 and 2018 and change the column values accordingly. Please see my edited section in the post above, i made small change to the column Model.Before the values in the Model column were 2016,2017,2018, i modified to Prod2016,Prod2017,Prod2018.