Forum Discussion

lukaspowerbi's avatar
lukaspowerbi
Helper II
9 years ago
Solved

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 ...
  • Anonymous's avatar
    Anonymous
    9 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