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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
aidenblake
Frequent Visitor

Filter Visual works as 'does not contain'

I have a following data:

 

ReceipeKey Receipe Ingredients

1PancakeFlour, Baking Soda, Sugar, Salt, Milk, Butter, Egg
2OmelettesFlour, Salt, Milk, Egg
3BreadFlour, Salt, Yeast, Water, Oil
4BunFlour, Sugar, Yeast, Milk, Butter, Salt, Egg

 

The goal is to filter for a single ingredient, so I have created a reference table for this purpose (which is connected to the previous table through the column 'Ingredients'):

 

Ingredients Ingredient Filter

Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggFlour
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggBaking Soda
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggSugar
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggSalt
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggMilk
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggButter
Flour, Baking Soda, Sugar, Salt, Milk, Butter, EggEgg
Flour, Salt, Milk, EggFlour
Flour, Salt, Milk, EggSalt
Flour, Salt, Milk, EggMilk
Flour, Salt, Milk, EggEgg
Flour, Salt, Yeast, Water, OilFlour
etc..etc..

 

This is working great so far if you want to filter for specific ingredients that you'd like in the recipe, such as Egg and Salt.

Problem: It doesn't work if you don't want a particular ingredient in the recipe. For example, if a user selects all ingredients except Milk (due to lactose intolerance), recipes with milk still appear because of other selected ingredients.

 

Question: Is there a way to ensure that only recipes without Milk are shown when Milk is not selected? I need this as a filtering option for users.

 

I would like to use it for a multi-page report, so using a measure as a filter for each visual is not the most optimal solution. Ideally, a dropdown filter would be the best option.

 

Thank you so much for your help.

1 REPLY 1
OwenAuger
Super User
Super User

Hi @aidenblake 

This is an interesting one 🙂

Before suggesting how to handle this in the model, I just wanted to clarify the requirements.

 

If mutiple Ingredients are not selected, should all Recipes that include at least one of those Ingredients be excluded?

 

1. For example, using the example data, if both Oil and Sugar are not selected, then Pankcake, Bread and Bun should be excluded, leaving just Omelettes visible?

OwenAuger_0-1724728322495.png

2. And in the simpler case of just excluding Milk, only Bread would be visible?

OwenAuger_1-1724728433100.png

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors