'Struggling with PowerBI slicer logic and process
I've tried to be "clever" setting up a slicer for improved visual experience, but it is not working as expected.
The slicer is based on a manually created table with two options:

This leads to a slicer which is compact and intuitive for report users (multi-select allowed):

I can then create a couple of measures that record all possible truth states of the slicer, e.g.
HideInactivePathSelected = --Truth status of slicer selection
IF (NOT ISFILTERED(SlicerHideOption),FALSE, --If no slicer options selected
IF(SELECTEDVALUE(SlicerHideOption[Options]) = "Hide inactive/former pathologists",TRUE, --Specific option selected
IF(COUNTROWS(VALUES(SlicerHideOption)) = 2,TRUE, --If both slicer options selected
FALSE --If all else fails
) ) )
This can be confirmed using a simple table, which updates instantly and correctly when the slicer is changed e.g.:

The problem is, at this point, if I try to refer to the state of the measure HideInactivePathSelected, things no longer work.
For instance, if I create a calculated column that refers to the measure state, this does not work. Consider this simplified example:
test_value =
IF([HideInactivePathSelected] = True, 2, 0)
If I then make a test table or chart based off test_value, changing the slicer has absolutely no effect.
I suspect I have tried to be "too clever" and perhaps I have misunderstood the (non)dynamic nature of calculated columns. Can some kind soul tell me what I have done wrong? Is this approach salvagable or do I need to start again?
Using PowerBI RS Desktop May 2021 edition.
Solution 1:[1]
Measures in calculated column do not see the row context, so you have to do context transition using Calculate function, e.g.:
test_value =
IF( CALCULATE( [HideInactivePathSelected] ) = True, 2, 0)
It should be easier to solve your issue if you provide some example data. There are better and more efficient ways to achieve the goal of filtering data in whole page, than using the measure and then calculated column.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | intruderr |
