Downloads
Power Query MList: transform and filterBeginner

List.Select

Keeps only the items in a list for which a condition is true.

Syntax
List.Select(list, selection)

Returns: A list with the matching items, in their original order.

What it does

List.Select runs a test on every item and keeps the ones that pass. It is the list version of a filter. Use it to pull out the amounts above an approval limit, the dates in a period, or the names that match a rule, without writing a full table query.

Syntax and arguments

Example

A company requires a second approver for any payment of 5,000 or more. The AP team has a list of payment amounts for the week and wants only the ones that need a second approver.

let
    Payments = {120, 4500, 80, 9000, 5000},
    NeedsApproval = List.Select(Payments, each _ >= 5000)
in
    NeedsApproval

The result is the list {9000, 5000}. Items below 5,000 are dropped and the rest keep their order. With a table, the same idea is Table.SelectRows, which works on whole rows.

Example: a second, different use

Keeping only text values that look like invoice numbers: List.Select(Codes, each Text.StartsWith(_, "INV-")).

Things to watch

In business terms

Approval limits, duplicate checks, aging buckets and exception reports often start with a filter. List.Select is the quick version for a single column of values. Use Table.SelectRows when you need to keep the rest of each row.

Related functions

All Power Query M functions · View as Markdown · M basics