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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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