Forum Discussion

Viswa11's avatar
Viswa11
Frequent Visitor
2 years ago
Solved

Need help in Power BI Desktop Filters pane

Hi All,

 

In Power BI Desktop, the filter pane restricts to applying only two conditions per column. However, I encountered a scenario where I needed to apply four conditions to a single column. The challenge arose because the category column I'm working with does not yet have all the values it will eventually contain, making basic filtering impractical. To address this, I turned to advanced filtering options in Power BI Desktop, but found that they also limit you to only two conditions.

I'm exploring alternative approaches to add more than two conditions, potentially using DAX (Data Analysis Expressions) or other methods. If you have any suggestions or insights on how to achieve this in Power BI Desktop, I would greatly appreciate your input.

Thanks in advance,

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Viswa11 ,

    What do you mean by "I don't have values in my category column"?
    I guess what you want to express is that your current data table in the category column data is incomplete, for example, you have a total of A, B, C, D, E five categories to participate in the filter, but the current table only exists in the A, B, C three categories, the subsequent will be added to the five. Is this what you mean?
    Then you can add an additional table with just one column Category containing all the categories. then create a RELATIONSHIP between this table and your datasheet and use this table to create the slicer:
    Here is my sample data:

    And add such a table for slicer:

    Build relationship:

    The final output is as below:


    Or you can use DAX, but using DAX will be a bit more cumbersome, unlike slicer, which is easy to use.
    I can give you an example:

    Measure = 
    IF(
        MAX('Table'[Category]) = "Gast" || MAX('Table'[Category]) = "Gyne" || MAX('Table'[Category]) = "Derm" || MAX('Table'[Category]) = "Orth",
        1,
        0
    )

    Proceed as shown in the figure below:

    The final output is as below:

     

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

3 Replies

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

    The easiest way would be to add a slicer. You can then hide the slicer if needed. Set the slicer to multi select if you want. 

    • Viswa11's avatar
      Viswa11
      Frequent Visitor

      Hi MattAllington ,

      Thanks for your suggestion but I don't have values in my category column it will add in future.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Viswa11 ,

        What do you mean by "I don't have values in my category column"?
        I guess what you want to express is that your current data table in the category column data is incomplete, for example, you have a total of A, B, C, D, E five categories to participate in the filter, but the current table only exists in the A, B, C three categories, the subsequent will be added to the five. Is this what you mean?
        Then you can add an additional table with just one column Category containing all the categories. then create a RELATIONSHIP between this table and your datasheet and use this table to create the slicer:
        Here is my sample data:

        And add such a table for slicer:

        Build relationship:

        The final output is as below:


        Or you can use DAX, but using DAX will be a bit more cumbersome, unlike slicer, which is easy to use.
        I can give you an example:

        Measure = 
        IF(
            MAX('Table'[Category]) = "Gast" || MAX('Table'[Category]) = "Gyne" || MAX('Table'[Category]) = "Derm" || MAX('Table'[Category]) = "Orth",
            1,
            0
        )

        Proceed as shown in the figure below:

        The final output is as below:

         

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