Forum Discussion
Two slicers (from same column) and one visual show excluded values.
Hello Everyone,
I have the below request and i was able to find the solution when i was using only one slicer from the below article (https://youtu.be/1SnELZGveYs?si=hCBTqIDxEq8UEwDk)
and could not able to resiprocate when i have to use two slicers for a visual.
Here is the problem statement with sample data but in real its a huge volume:
Two Slicers (both contains "Country" Column) and a Matrix visual(it contains Flags and Country in rows as hierarchy).
| Country | Flags |
| India | Yellow |
| Australia | Blue |
| USA | |
| Africa |
Steps1 : when None of the slicers are selected with any values, then the Matrix displays data as below in hierarchy way as below on rows section (excluding other data as its not the point of concern).
| Yellow |
| India |
| Blue |
| India |
| Australia |
| USA |
| Africa |
Steps 2: when i select "India" from first slicer then the output is as below which is working as expected.
| Yellow |
| India |
| Blue |
| India |
Step 3: when i select other than india value from second slicer. then it should show up as below (excluded selection).
for example, if i select "Africa" since Africa is not part of Yellow and it should show only Yellow.
| Yellow |
| India |
I followed the article mentioned at the top and created a new table with distinct value and a measure for excluded list but i was working fine when it is having only one slicer.
looking for any relevant solution for my request.
Thanks
Teja
- Anonymous2 years ago
Hi SritejaGolla
Please try this:
Here I create a measure:
MEASURE = VAR _Slicer2 = SELECTEDVALUE ( SeperateTable[Industry] ) VAR _Vtable = SELECTCOLUMNS ( FILTER ( ALL ( 'TestTable' ), 'TestTable'[Industry] = _Slicer2 ), "_Country", [Country] ) RETURN IF ( SELECTEDVALUE ( TestTable[Country] ) IN _Vtable, BLANK (), SELECTEDVALUE ( TestTable[Industry] ) )Then add it to the table visual.
the result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- AllisonKennedy
Community Champion
SritejaGolla can you share the file with sample data or some screenshots of what's not quite working? You should be able to make it work with two slicers just as one, but may need to create another disconnected table for this to work and be deliberate which tables you use in each slicer. Then you'll need to modify the DAX a tiny bit to account for your two slicers / tables.
- SritejaGolla
Microsoft Employee
AllisonKennedy , the Data looks like
Contry Industry India Oil India Power India Construction US Power US Software UAE Oil UAE Food UAE Electronics
If User selected first slicer "Industry" (which is for selection):
Input ---> Industry : Power [in slicer]
Output --->Country Industry India Power US Power
and User selects 2nd slicer "Oil" (which needs to exclude the country which has Oil)
Input ----> Indutry : Oil [in slicer to exclude]
Output--->Country Industry US Power
- SritejaGolla
Microsoft Employee
AllisonKennedy here the sample data PBI file.
TestPBIdata.pbix- AnonymousNot applicable
Hi SritejaGolla
Please try this:
Here I create a measure:
MEASURE = VAR _Slicer2 = SELECTEDVALUE ( SeperateTable[Industry] ) VAR _Vtable = SELECTCOLUMNS ( FILTER ( ALL ( 'TestTable' ), 'TestTable'[Industry] = _Slicer2 ), "_Country", [Country] ) RETURN IF ( SELECTEDVALUE ( TestTable[Country] ) IN _Vtable, BLANK (), SELECTEDVALUE ( TestTable[Industry] ) )Then add it to the table visual.
the result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.