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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors