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
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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors