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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Querymaster
Frequent Visitor

Filter Formulations

I have this table:

SampleIDIngredient nameIngredient weight%
Aabc10
Adef15
Aghi25
Ajkl40
Amno10
Bghi40
Bjkl20
Bpqr40
Cabc15
Cghi35
Cstu60

 

I would like to use a slicer to search for ingredient names. E.g a search for 'abc' should result in:

SampleIDIngredient nameIngredient weight%
Aabc10
Adef15
Aghi25
Ajkl40
Amno10
Cabc15
Cghi35
Cstu60

but it ends up in:

SampleIDIngredient nameIngredient weight%
Aabc10
Cabc15

 

2 questions:

1. How can I filter but still see all Ingredients for the samples that contain the search item?

2. How can I search for samples that contain both 'abc' and 'ghi'?

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Querymaster 

 

I created the sample as yours , and add another table with only one column [Ingredient name]using for slicer.

 

Then add the measure:

Measure for weight% = var a = CALCULATE(MAX(Table1[SampleID]),FILTER(ALL(Table1[Ingredient name]),[Ingredient name]=SELECTEDVALUE(Table2[Ingredient name])))
Return
IF(SELECTEDVALUE(Table2[Ingredient name])=BLANK(),MAX(Table1[Ingredient weight%]),CALCULATE(MAX(Table1[Ingredient weight%]),FILTER(Table1,[SampleID]=a)))

00.png

When you use the slicer to select both 'abc' and 'ghi', actually it means resulting in weight% which satisfied both 'abc' and 'ghi', it will return nothing. Thus we’d better use the measure to create the “Or” relationship

Measure for "abc"&"ghi"= var a = CALCULATE(MAX(Table1[SampleID]),FILTER(ALL(Table1[Ingredient name]),[Ingredient name]="abc"||[Ingredient name]="ghi"))
Return
CALCULATE(MAX(Table1[Ingredient weight%]),FILTER(Table1,[SampleID]=a))

01.png

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Querymaster ,

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
v-diye-msft
Community Support
Community Support

Hi @Querymaster 

 

I created the sample as yours , and add another table with only one column [Ingredient name]using for slicer.

 

Then add the measure:

Measure for weight% = var a = CALCULATE(MAX(Table1[SampleID]),FILTER(ALL(Table1[Ingredient name]),[Ingredient name]=SELECTEDVALUE(Table2[Ingredient name])))
Return
IF(SELECTEDVALUE(Table2[Ingredient name])=BLANK(),MAX(Table1[Ingredient weight%]),CALCULATE(MAX(Table1[Ingredient weight%]),FILTER(Table1,[SampleID]=a)))

00.png

When you use the slicer to select both 'abc' and 'ghi', actually it means resulting in weight% which satisfied both 'abc' and 'ghi', it will return nothing. Thus we’d better use the measure to create the “Or” relationship

Measure for "abc"&"ghi"= var a = CALCULATE(MAX(Table1[SampleID]),FILTER(ALL(Table1[Ingredient name]),[Ingredient name]="abc"||[Ingredient name]="ghi"))
Return
CALCULATE(MAX(Table1[Ingredient weight%]),FILTER(Table1,[SampleID]=a))

01.png

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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