Forum Discussion
Custom visual
Hello.
I have a table type visual where I want to have my result sets displayed by using two different slicers.
As of now, when I click on one slicer(Region), it displays the result in a table type visual just like it should be, however, when I click on the second one (District/National Council), the result is being replaced.
My goal is to keep both results in my table type visual, basically stack it up. First slicer result + second slicer result
- Anonymous9 years ago
HI lukaspowerbi,
You can refer to below steps to achieve your requirement.
Sample:
1. Use slicer source columns to create new table.(not need to build relationship with original table)
FirstName = VALUES(DimEmployee[FirstName]) LastName = VALUES(DimEmployee[LastName])
2. Add measure to source table of table visual to check the select status from slicers.Check Tag = var checkA=IF(COUNTROWS(ALL(FirstName))=COUNTROWS(ALLSELECTED(FirstName)),FALSE(),//block allselect CONTAINS(ALLSELECTED(FirstName[FirstName]),FirstName[FirstName],MAX(DimEmployee[FirstName]))) var checkB=IF(COUNTROWS(ALL(LastName))=COUNTROWS(ALLSELECTED(LastName)),FALSE(),//block allselect CONTAINS(ALLSELECTED(LastName[LastName]),LastName[LastName],MAX(DimEmployee[LastName]))) return if(checkA||checkB,"Y","N")
3. Add two slicer with new table columns as the source, drag measure into table visual and modify the visual level filter to 'is Y".Result:
Notice: if you not want to block all select, you can remove that part of formula.
Regards,
Xiaoxin Sheng
7 Replies
- AnonymousNot applicable
HI lukaspowerbi,
You can refer to below steps to achieve your requirement.
Sample:
1. Use slicer source columns to create new table.(not need to build relationship with original table)
FirstName = VALUES(DimEmployee[FirstName]) LastName = VALUES(DimEmployee[LastName])
2. Add measure to source table of table visual to check the select status from slicers.Check Tag = var checkA=IF(COUNTROWS(ALL(FirstName))=COUNTROWS(ALLSELECTED(FirstName)),FALSE(),//block allselect CONTAINS(ALLSELECTED(FirstName[FirstName]),FirstName[FirstName],MAX(DimEmployee[FirstName]))) var checkB=IF(COUNTROWS(ALL(LastName))=COUNTROWS(ALLSELECTED(LastName)),FALSE(),//block allselect CONTAINS(ALLSELECTED(LastName[LastName]),LastName[LastName],MAX(DimEmployee[LastName]))) return if(checkA||checkB,"Y","N")
3. Add two slicer with new table columns as the source, drag measure into table visual and modify the visual level filter to 'is Y".Result:
Notice: if you not want to block all select, you can remove that part of formula.
Regards,
Xiaoxin Sheng
- lukaspowerbiHelper II
Thank you for you reponse. Could you elaborate a little on those three steps? Especially the first step of creating new table by using slicer source columns?
Thank you.
- AnonymousNot applicable
Hi lukaspowerbi,
>>Could you elaborate a little on those three steps? Especially the first step of creating new table by using slicer source columns?
I share the pbix file as attachments, hope this will be help.
Regards,
Xiaoxin Sheng