Forum Discussion
Anonymous
4 years agoNot applicable
Filter matrix based on values columns
Is there a way to only return rows in a matrix visualization that match ALL criteria provided by a hierarchical slicer? I've Googled this a bit and haven't found a solid solution yet. Source data...
- Anonymous4 years ago
Posting my own solution for visibility. I ended up creating a single measure that returns 1 if the slicer selection conditions are met and 0 if they are not. That measure gets applied as a visual level filter to the matrix, which is set to only show items when that value is 1.
#RecordMeetsConditions = VAR NumOfSelectedAttrVal = DISTINCTCOUNT ( 'my table'[attr_value] ) VAR SelectedNumCols = CALCULATE( DISTINCTCOUNT ( 'my table'[attr_name] ) , ALLSELECTED(my table) ) VAR bool = IF(NumOfSelectedAttrVal = SelectedNumCols, 1, 0) RETURN bool
Anonymous
4 years agoNot applicable
Posting my own solution for visibility. I ended up creating a single measure that returns 1 if the slicer selection conditions are met and 0 if they are not. That measure gets applied as a visual level filter to the matrix, which is set to only show items when that value is 1.
#RecordMeetsConditions =
VAR NumOfSelectedAttrVal = DISTINCTCOUNT ( 'my table'[attr_value] )
VAR SelectedNumCols =
CALCULATE(
DISTINCTCOUNT ( 'my table'[attr_name] ) ,
ALLSELECTED(my table)
)
VAR bool = IF(NumOfSelectedAttrVal = SelectedNumCols, 1, 0)
RETURN
bool