Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

OR condition on multiple slicer selections

I have a streaming dataset dashboard that 6 slicers currently available for a table of data.

The 6 slicers each represent a different column in the table but I need them to act as OR's and not AND's when selected.

I am stumped on how to achieve this.

 

 

  • Hi, Anonymous ;

    I made a simple document to illustrate it.

    1.The first step is to have 6 tables independent of each other, without any relationship (my file here is using two slicers, so two tables)

    2.Then create a measure.

    flag = IF(MAX('Table'[column1]) in ALLSELECTED(slicer1[column1])||MAX('Table'[column2]) in ALLSELECTED(slicer2[column2]),1,0)

    3.apply the flag measure into filter.

    The final output is shown below:

    If you also not clear, can you share me the simplr file after removing the sensitive information?

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Anonymous you have to use disconnected tables for your slicers and then write measure to filter based on the selection, reason you want disconnected table because it will not filter your transaction table, and will only get filtered thru using measure which then you can control.

     

    Follow us on LinkedIn and  to our YouTube channel

     

    Learn about conditional formatting at Microsoft Reactor

    My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    • Anonymous's avatar
      Anonymous
      Not applicable

      I am new to this so I am not familiar with disconnected tables. How do I go about doing this? The option for creating a new table under modeling is greyed out which I assume is because I am using a streaming dataset?

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous ;

    I made a simple document to illustrate it.

    1.The first step is to have 6 tables independent of each other, without any relationship (my file here is using two slicers, so two tables)

    2.Then create a measure.

    flag = IF(MAX('Table'[column1]) in ALLSELECTED(slicer1[column1])||MAX('Table'[column2]) in ALLSELECTED(slicer2[column2]),1,0)

    3.apply the flag measure into filter.

    The final output is shown below:

    If you also not clear, can you share me the simplr file after removing the sensitive information?

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • aallman's avatar
      aallman
      Icon for Helper II rankHelper II

      I have the same problem where I want to have 3 slicers act as OR filters on my visual. I tried to use your solution but it doesn't quite work. If you select no filter in one of my 3 slicers, then the data doesn't get filtered at all. It seems to be the same case with your example data:

       

      how can I get this to work so that no selection in one of the slicers will cause the data to filter only by actual selections?

       

    • hi_world's avatar
      hi_world
      Icon for Helper III rankHelper III

      Hello v-yalanwu-msft , 
      amazing solution ! Bravo

      Do you know a way to do it without create multiple table each table for slicer ? 
      Or maybe create table in dax and use it in the same flag measure ? 
      Best regards