Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
| 401001 | A | 2 |
| 401001 | A | 3 |
| 401001 | A | 1 |
| 401002 | B | 4 |
| 401002 | B | 5 |
| 401001 | B | 3 |
| 401001 | C | 1 |
| 401004 | C | 8 |
| 401004 | D | 2 |
| 401004 | D | 1 |
| 401003 | A | 2 |
| 401004 | F | 2 |
Solved! Go to Solution.
Hello @Anonymous ,
Thank you for your reply and your comment
I'm going to use this code and remove the true operator
Best regards
Looks good--but you don't need the "=true" in either place.
--Nate
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |