Forum Discussion

barakm's avatar
barakm
Frequent Visitor
2 years ago
Solved

Using more than 2 filters best practice

Dear all, 

What would be the best practice to add more than 2 filters available in the filtering tab ? 

For example:

I have a table visual and I wish to show all values that not contains  "A" or "B" or "C" or "D"  

looking at the filtering tab, I see that I can only use "A" or "B"   

Thank you

Barak

  • Hi barakm 

     

    You can add the same field to the filter pane multiple times. Depending on what behavior you want the filters to have, this may or may not work for your use case:

     

     

    An alternative would be to add a calculated column (DAX or in Power Query) that checks for all the conditions you want, and returns True or False for each row in your data. Then you can use this calculated column as a filter. Here is how that would look like using DAX calculated columns:


    in the if statement, || is the OR operator, && is the AND operator, and CONTAINSSTRING evaluates to True or False for each criteria.


    I guess it might work as a measure as well, similar to SamWiseOwl's solution.

    I hope this helps!

3 Replies

  • Hi barakm 

    One way of doing this is creating a Measure that defines what to keep and what not.
    Then use this as a filter on your measure:

    If this helps please mark as a solution for others to find 🙂
    Let me know how you get on!

  • barakm's avatar
    barakm
    Frequent Visitor

    Hi SamWiseOwl...

    Thank you very much for your reply, this is nice perspective to do it 

    I tried this, and it worked but for exact match.

    How do I change this for somthing that only contains these attributes ?

    for example if I do  "A" or "B" or "C" or "D"   I wish it would match also values like "bananA" or "Dongle" or "sCaner" 

    • dk_dk's avatar
      dk_dk
      Super User

      Hi barakm 

       

      You can add the same field to the filter pane multiple times. Depending on what behavior you want the filters to have, this may or may not work for your use case:

       

       

      An alternative would be to add a calculated column (DAX or in Power Query) that checks for all the conditions you want, and returns True or False for each row in your data. Then you can use this calculated column as a filter. Here is how that would look like using DAX calculated columns:


      in the if statement, || is the OR operator, && is the AND operator, and CONTAINSSTRING evaluates to True or False for each criteria.


      I guess it might work as a measure as well, similar to SamWiseOwl's solution.

      I hope this helps!