Forum Discussion
How to filter a table
- 5 years ago
Small change at the end:
ShowMeasure V2= VAR G2inTable_ = CALCULATETABLE ( DISTINCT ( MyTable[Group-2] ), ALL ( MyTable[Group-2] ) ) VAR G2InSlicer_ = DISTINCT ( SlicerT[Group-2] ) VAR allPresent_ = COUNTROWS ( INTERSECT ( G2inTable_, G2InSlicer_ ) ) = COUNTROWS ( G2InSlicer_ ) RETURN IF ( (allPresent_ || NOT ISFILTERED ( SlicerT[Group-2] )) && SELECTEDVALUE(MyTable[Group-2]) IN G2InSlicer_ , 1, 0 )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi kerch007
1. Create a new one-column table with all the values of Group-2 that will be used for the slicer. Let's call it SlicerT
2. Create this measure:
ShowMeasure =
VAR G2inTable_ =
CALCULATETABLE ( DISTINCT ( MyTable[Group-2] ), ALL ( MyTable[Group-2] ) )
VAR G2InSlicer_ =
DISTINCT ( SlicerT[Group-2] )
VAR allPresent_ =
COUNTROWS ( INTERSECT ( G2inTable_, G2InSlicer_ ) ) = COUNTROWS ( G2InSlicer_ )
RETURN
IF ( allPresent_ || NOT ISFILTERED ( SlicerT[Group-2] ), 1, 0 )
3. Assuming you have the visual you show in place, place [ShowMeasure] in the filters of that visual and select to show when the value of the measure is 1
See it all at play in the attached file.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- kerch0075 years agoFrequent Visitor
Many thanks!
Almost what I need.
Please tell me how to remove unnecessary values that are not in the slicer?Screen: https://ibb.co/ZV1vP5g
- AlB5 years agoCommunity Champion
Small change at the end:
ShowMeasure V2= VAR G2inTable_ = CALCULATETABLE ( DISTINCT ( MyTable[Group-2] ), ALL ( MyTable[Group-2] ) ) VAR G2InSlicer_ = DISTINCT ( SlicerT[Group-2] ) VAR allPresent_ = COUNTROWS ( INTERSECT ( G2inTable_, G2InSlicer_ ) ) = COUNTROWS ( G2InSlicer_ ) RETURN IF ( (allPresent_ || NOT ISFILTERED ( SlicerT[Group-2] )) && SELECTEDVALUE(MyTable[Group-2]) IN G2InSlicer_ , 1, 0 )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- kerch0075 years agoFrequent VisitorExactly what I need! Thanks!