Forum Discussion
jhsimb
2 years agoFrequent Visitor
List.Contains() is slow
I tried to filter a column based on a list I used List.Contains() but it is very slow = Table.SelectRows(Medidas, each (List.Contains(Resta,[Cliente])=true )) Please your help with a faster ...
Anonymous
2 years agoNot applicable
= Table.SelectRows(Medidas, each List.Contains(List.Buffer(Resta),[Cliente]))
--Nate
AlienSx
2 years agoSuper User
Anonymous I would List.Distinct(Resta) before buffering and buffer outside of Table.SelectRows. My tests show that List.Contains works even faster than List.PositionOf on the same data.
But the fastest one is to create a record with unique Resta data as field names and "true" as value then
Table.SelectRows(values, each Record.FieldOrDefault(resta_record, Text.From([Cliente]), false))