Forum Discussion
Anonymous
7 years agoNot applicable
Filter Table based on multiple True/False columns
Hi all, I am trying to create a filter table Z that manages four boolean columns in another table X. For example, if the filter is set to "A", then it filters out all the FALSE statements in colu...
- 7 years ago
Anonymous add a measure in your table as below:
What to Filter? = VAR __filter = SELECTEDVALUE( 'Filter Table'[Filter] ) VAR __Isfilter = SWITCH( __filter, "A", SELECTEDVALUE( table3[A] ) = TRUE(), "B", SELECTEDVALUE( table3[B] ) = TRUE(), "C", SELECTEDVALUE( table3[C] ) = TRUE(), "D", SELECTEDVALUE( table3[D] ) = TRUE() ) RETURN IF( __Isfilter = TRUE(), 1, 0 )on your table visual, add visual level filter and select "What to filter?" is 1 as shown below and based on your selection in slicer, it will filter table accordingly
parry2k
7 years agoSuper User
Anonymous your dax expression is also good but best practice and experts recommend to break it into pieces, it is much easier to debug, easy to read and easy to make the changes in future if someone else is looking at the expression.
Again your expression would work but bit difficult to ready at first go.
Anonymous
7 years agoNot applicable
Thanks parry2k !