Forum Discussion
Create AND/OR filtering
- Anonymous1 year ago
Hi,
Thanks for the solution ryan_mayu and ToddChitt offered, and i want to offer some more information for user to refer to.
hello adoster , you can refer to the following sample.
1.Create three new tables(there is no relationship among tables)
Slicer A
Slicer B
And/or table.
2.Create a measure.
MEASURE = IF ( ISFILTERED ( 'And/Or'[Type] ), SWITCH ( SELECTEDVALUE ( 'And/Or'[Type] ), 1, CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[ColumnA] IN VALUES ( SlicerA[Value] ), 'Table'[ColumnB] IN VALUES ( SlicerB[Value] ) ), 0, CALCULATE ( COUNTROWS ( 'Table' ), OR ( 'Table'[ColumnA] IN VALUES ( SlicerA[Value] ), 'Table'[ColumnB] IN VALUES ( SlicerB[Value] ) ) ) ), CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[ColumnA] IN VALUES ( SlicerA[Value] ), 'Table'[ColumnB] IN VALUES ( SlicerB[Value] ) ) )3.Then put the values of three new tables to three slicers, and put the measure and the related field in original table to a table visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks for the solution ryan_mayu and ToddChitt offered, and i want to offer some more information for user to refer to.
hello adoster , you can refer to the following sample.
1.Create three new tables(there is no relationship among tables)
Slicer A
Slicer B
And/or table.
2.Create a measure.
MEASURE =
IF (
ISFILTERED ( 'And/Or'[Type] ),
SWITCH (
SELECTEDVALUE ( 'And/Or'[Type] ),
1,
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[ColumnA] IN VALUES ( SlicerA[Value] ),
'Table'[ColumnB] IN VALUES ( SlicerB[Value] )
),
0,
CALCULATE (
COUNTROWS ( 'Table' ),
OR (
'Table'[ColumnA] IN VALUES ( SlicerA[Value] ),
'Table'[ColumnB] IN VALUES ( SlicerB[Value] )
)
)
),
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[ColumnA] IN VALUES ( SlicerA[Value] ),
'Table'[ColumnB] IN VALUES ( SlicerB[Value] )
)
)
3.Then put the values of three new tables to three slicers, and put the measure and the related field in original table to a table visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- adoster1 year agoResolver I
While this technically works it requires a new table for every slicer which at scale is cumbersome. I have about 10 values at this time requiring an AND/OR option so this may work short term, but likely will submit an idea for this type of functionality to be implemented similar to what Tableau offers unless there is an alternative solution. Thank you for this workaround.