The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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