Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Filter a visual by non selected Slicer

Hi,

 

Currently I have a report that has a table that lists all the clients we have.

 

The slicer I am using is just a list of our clients.

 

What I want to do is filter the table to show all the clients that are in the same industry as the one selected in the slicer.

 

The client table has industry 

 

Then once this is done only show the top 10 sales figures for the industry.

 

Currently the table will only filter and show the client selected in the slicer unless I disconnect them and then all data is shown.

 

Can anyone help me filter the table by industry and not client

 

Thank you

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi @BIDrone,

     

    Please check followings steps as below:

    1. Create measure:

        TOPN = RANKX(ALL('Table'[client]),[Measure])

        Measure = SUM('Table'[sales ])

        Measure 2 =

        VAR sv =

            SELECTEDVALUE ( 'Table 2'[client] )

        VAR ind =

            CALCULATE (

                MAX ( 'Table'[industry ] ),

                FILTER ( ALL ( 'Table' ), 'Table'[client] = sv )

            )

        RETURN

            IF ( MAX ( 'Table'[industry ] ) = ind && [TOPN] < 4, 1, BLANK () )

    2. Add measure 2 to filter:

    3. Result would be shown as below:

    BTW, Pbix as attached. Hopefully works for you.

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jay

       

      Thank you for coming back to me.

       

      Unfortuantley the code doesnt work I still get 1's next to the client whether it is in the same industry or not.

       

      I have opend your PBIX file but it doesnt contain the code in it.

       

      I'll keep trying with the code.

       

      Thank you again

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Please check this pbix again.

        Otherwise, please share your sample data to me if you don't have any Confidential Information.

        Please let me know if i can help.

         

        Best Regards,

        Jay