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
Mederic
Post Patron
Post Patron

Multiple List of criteria

Hello,


I have a table with more than ten thousand rows,
And 2 lists of criteria, each with up to fifty cells
I thought of using the code below.
Is there a better, more elegant way?

Thanks in advance

 

Best regards

 

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Supplier", Int64.Type}, {"Product", type text}, {"Réf", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each List.Contains(List.Buffer(Criteria1),[Supplier])=true and List.Contains(List.Buffer(Criteria2),[Réf])=true)
in
    #"Filtered Rows"

 

SupplierProductRéf

401001A2
401001A3
401001A1
401002B4
401002B5
401001B3
401001C1
401004C8
401004D2
401004D1
401003A2
401004F2

 

MultiCriteres.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Looks good--but you don't need the "=true" in either place.

 

--Nate

View solution in original post

2 REPLIES 2
Mederic
Post Patron
Post Patron

Hello @Anonymous ,

Thank you for your reply and your comment
I'm going to use this code and remove the true operator

Best regards

Anonymous
Not applicable

Looks good--but you don't need the "=true" in either place.

 

--Nate

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.