Forum Discussion

jdusek92's avatar
jdusek92
Icon for Advocate III rankAdvocate III
7 years ago

Filtering between 2 views - with a shared subset of rows

Hello,

I have this scenario: I have this data table loaded in PBI:

I want to be able to switch between view Y (rows 1-9) and view X (rows 4-12) by selecting the view I want with a slicer/filter - NOT by deselecting the subset of rows I want to hide.

I just want to have a slicer with two options: View X and View Y.

 

Is there a way to do so WITHOUT having to duplicate rows that should be visible in both views?

 

Warm regards,

Jakub

3 Replies

  • Hi jdusek92 ,

     

    Create a table for the slicer with the Y / X lines then add the following measure:

    Selection =
    SWITCH (
        TRUE ();
        SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "X"
            && (
                SELECTEDVALUE ( Views_Table[vyew] ) = "X"
                    || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
            ); 1;
        SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "Y"
            && (
                SELECTEDVALUE ( Views_Table[vyew] ) = "Y"
                    || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
            ); 1;
        0
    )

    Now use tihs measure as a visual filter and select only the values equal to 1.

     

    Check PBIX file attach.

     

    Regards,

    MFelix

  • Hi jdusek92 ,

     

    Create a table for the slicer with the Y / X lines then add the following measure:

    Selection =
    SWITCH (
        TRUE ();
        SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "X"
            && (
                SELECTEDVALUE ( Views_Table[vyew] ) = "X"
                    || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
            ); 1;
        SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "Y"
            && (
                SELECTEDVALUE ( Views_Table[vyew] ) = "Y"
                    || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
            ); 1;
        0
    )

    Now use tihs measure as a visual filter and select only the values equal to 1.

     

    Check PBIX file attach.

     

    Regards,

    MFelix