Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Unselect all should hide all the data

Just like how it is done in Tableau. when you click on 'Select all' all the data is shown in the dashboard as visuals, but when you click 'Select all' again and the tick boxes disappear, all the data should also disappear, is there a way to achieve that in Power BI?

 

 

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

    Table 2 = VALUES('Table'[Client])

    2. add a slicer visual with Table 2 field, add a table visual with Table field

    3. create a measure with below dax formula and add it to table visual filter pane

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Client] )
    VAR _b =
        SELECTEDVALUE ( 'Table 2'[Client] )
    VAR _c =
        CONCATENATEX ( 'Table 2', [Client] )
    RETURN
        IF (
            ISFILTERED ( 'Table 2'[Client] ),
            IF (
                HASONEFILTER ( 'Table 2'[Client] ),
                IF ( _b = _a, 1 ),
                IF ( CONTAINSSTRING ( _c, _b ), 1 )
            ),
            0
        )
    

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

    Table 2 = VALUES('Table'[Client])

    2. add a slicer visual with Table 2 field, add a table visual with Table field

    3. create a measure with below dax formula and add it to table visual filter pane

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Client] )
    VAR _b =
        SELECTEDVALUE ( 'Table 2'[Client] )
    VAR _c =
        CONCATENATEX ( 'Table 2', [Client] )
    RETURN
        IF (
            ISFILTERED ( 'Table 2'[Client] ),
            IF (
                HASONEFILTER ( 'Table 2'[Client] ),
                IF ( _b = _a, 1 ),
                IF ( CONTAINSSTRING ( _c, _b ), 1 )
            ),
            0
        )
    

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.