Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
stesc
Regular Visitor

Combined conditional filtering

Hey there! 

 

I have a problem that I hope someone that is more well-versed in Power-BI can help me with. 

 

Before I start, it might be important to know, that the file get its data from a DirectQuery connection to a SSAS database. I don't currently have access to it and might first be able to get direct access to it in 2-3 weeks. 

 

So i'm working in a PBI report that I haven't built myself. 

 

I have the following measures of data: 

  • Title = of the product
  • Vendor = full of various shop names and something called "Recycling Station" 
  • Status = either "sold", "waiting", or "for sale". 
  • Tax = "true" or "false"

I've been asked to set up a combined filter whereby I only show products when: 

  1. Vendor is "Recycling Station" AND Tax is False
  2. Vendor is anything other than "Recycling Station" AND Tax is True

 

Chat GPT told me to use "Advanced filtering" and adding second + third conditions using the +AND / +OR functionality:
"

  1. Set up the first condition:

    • For the first condition, choose the following:
      • Field: Vendor
      • Filter type: Equals
      • Value: Recycle
  2. Add a second condition:

    • Click on the "+ AND" button to add a second condition.
    • For the second condition, choose the following:
      • Field: Tax
      • Filter type: Equals
      • Value: False
  3. Add a third condition for the second scenario:

    • Click on the "+ OR" button to add another set of conditions.
    • In this new set of conditions:
      • For the first condition, choose the following:
        • Field: Vendor
        • Filter type: Does not equal
        • Value: Recycle
      • For the second condition, choose the following:
        • Field: Tax
        • Filter type: Equals
        • Value: True"


But I can't see that I have the options of adding second + third conditions in either my browser or desktop versions of PBI. 

Chat GPT then advises that I create formulas in DAX instead. Can anyone confirm if that is necessary or if there is a way of doing it with the existing filtering functionalities? 

 

Much appreciated from a Power-BI padawan. 

1 ACCEPTED SOLUTION
TobyNye
Resolver II
Resolver II

Hi, I made a sample dataset to approximate yours below:

TobyNye_0-1700836078878.png

The easiest thing to do is just create a slicer with a hierarchy:

TobyNye_1-1700836124636.png

The slicer has the tax and Vendor field. If you put multiple fields in a slicer it creates a hierarchy so, all available values of the tax field as it is on top, then all of the different vendors that have that value somewhere in your table. If you were to put vendor on top it would look like this:

TobyNye_2-1700836222380.png

Hope this helps, let me know if you have any issues or further questions.

View solution in original post

2 REPLIES 2
stesc
Regular Visitor

It works! Thank you so much Toby. You're a lifesaver. Happy NY and godspeed man! 🙂 

TobyNye
Resolver II
Resolver II

Hi, I made a sample dataset to approximate yours below:

TobyNye_0-1700836078878.png

The easiest thing to do is just create a slicer with a hierarchy:

TobyNye_1-1700836124636.png

The slicer has the tax and Vendor field. If you put multiple fields in a slicer it creates a hierarchy so, all available values of the tax field as it is on top, then all of the different vendors that have that value somewhere in your table. If you were to put vendor on top it would look like this:

TobyNye_2-1700836222380.png

Hope this helps, let me know if you have any issues or further questions.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.