Forum Discussion
Anonymous
6 years agoNot applicable
PowerBi Slicer and Matrix Visualisation Issue
Hello I have a problem, where I create a Slicer(Attribute) and select multiple items to display into the Matrix table it shows me blank spaces which I do not want to see as I only want to see the the values selected. I notice that the Matrix filter has been set to "Or". How can I change it to "And"
For example, when I select 2 subjects on the slicer table (Attribute), it displays blank spaces and values In the Matrix However,i only want the values to appear.
Hi Anonymous ,
You need to drag the measure(Subject with AND-Only Condition) into filter pane and choose "is not blank" then apply filter.
Hope this can help you.
7 Replies
- AllisonKennedyCommunity ChampionAnonymous
Slicers are always an OR condition, but you can create a custom measure to get the AND result you want.
See if this post can help you out: https://community.powerbi.com/t5/Desktop/Slicer-with-quot-AND-quot-logic/td-p/592018
If you need it specific to your scenario you will need to provide sample data please.
PS, I am going to move this to Desktop thread where it will get more views and help since it is not related specifically to Power Query. Cheers!- AnonymousNot applicable
Hi,
Attached below is my code however it not working.
For your kind assistance please.- v-xuding-msftCommunity Support
Hi Anonymous ,
Please try this:
New Table as slicer:
Subject = VALUES('Table'[Subject])A measure:
Subject with AND-Only Condition = var selectedSubject=VALUES(Subject[Subject]) var countRowsFact= COUNTROWS( DISTINCT( SELECTCOLUMNS( FILTER( 'Table', RELATED(Subject[Subject]) in selectedSubject ), "Subject", RELATED(Subject[Subject]) ) ) ) var countRowsSubject=COUNTROWS(selectedSubject) return IF(countRowsFact>=countRowsSubject,countRowsFact)