Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Slicer - selecting mutliple values should only display results that have all the values

Hello,

I have a table visual that should display only the values selected by the slicer. For example, when I click the values : Rx, Vx & US in the slicer, content lab should appear in my table under app name as it is used by all these users. However, when I select these three values in the slicer, all apps which are used by Rx, Vx or US are displayed. What is the best way to solve this?File 1

  • MFelix's avatar
    MFelix
    6 years ago

    Hi Anonymous ,

     

    Create the following measure to filter your visualizations:

     

    ShowMeasure =
    VAR _EmptySlicer =
        CALCULATE ( ISFILTERED ( 'Table'[User] ); ALLSELECTED ( 'Table'[User] ) )
            = FALSE ()
    RETURN
        IF (
            NOT ( _EmptySlicer );
            IF (
                CALCULATE ( DISTINCTCOUNT ( 'Table'[User] ); ALLSELECTED ( 'Table'[User] ) )
                    = COUNTROWS ( ALLSELECTED ( 'Table'[User] ) );
                1
            )
        )

    If you now make a filter on the table based on this measure equal 1 you result will give expected valu.

     

    In this measure we are forcing the AND logic to the slicer instead of the OR that is ussually aplied.

     

    Check PBIX file attach.

     

5 Replies

  • Hi Anonymous ,

     

    Looking at the data you present and at the description the slicer is giving the correct result. 

     

    When you select a value on a slicer the values on the column of the slicer are filter out accordingly so when you add the Rx, Vx, & US you get all the values that have one line for those.

     

    What do you want to achieve you want to only pick up the ones that have a match of the 3 selected values in the slicer?

    If this is the case and based on your images is the correct result:

    Content  Lab

    MIND - Veeva VaultMedComms

    Med Product Master System

     

    Or do you only want to displau the Content Lab?

    If you only want the content lab then there is some other specification that you need to add to the calculation.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi MFelix,

      Thank you for your message. I want to achieve the following. Let's say I selected the values Rx, Vx & US then it should display all apps that are used by those 3 at the same time and not by one of the three. When I click on oncology in the slicer as an extra value, my table should be empty because none of the apps has all these 4 values as users, however the table displays all the apps that are used by Rx or Vx or US or Oncology instead of Rx and Vx and US and Oncology. Hope this helps.

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        Hi Anonymous ,

         

        Create the following measure to filter your visualizations:

         

        ShowMeasure =
        VAR _EmptySlicer =
            CALCULATE ( ISFILTERED ( 'Table'[User] ); ALLSELECTED ( 'Table'[User] ) )
                = FALSE ()
        RETURN
            IF (
                NOT ( _EmptySlicer );
                IF (
                    CALCULATE ( DISTINCTCOUNT ( 'Table'[User] ); ALLSELECTED ( 'Table'[User] ) )
                        = COUNTROWS ( ALLSELECTED ( 'Table'[User] ) );
                    1
                )
            )

        If you now make a filter on the table based on this measure equal 1 you result will give expected valu.

         

        In this measure we are forcing the AND logic to the slicer instead of the OR that is ussually aplied.

         

        Check PBIX file attach.

         

  • Hi Anonymous ,

     

    The filter selection is displaying the combination of the columns that you have in your table visual.

    Medical Capability

    App Name

    Users

     

    So when Users are selected as - RX, Vx, US; they will have everything in the data for the combination of 3 columns in the table above.

     

    So, in short, this is coming from your data.

     

    Thanks,

    Pragati

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    The screenshot posted do not show any slicer selection? what is that you want to achieve?

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn