OpenBI Docs Buy

List.Select

The items of a list that meet a condition, in their order.

Group: List. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

List.Select(list as list, selection as function) as list
ParameterTypeDescription
listlistThe list.
selectionfunctionA function of one item that answers true to keep it.

Returns

list. The items kept.

Examples

Sales, not refunds

List.Select({120, -15, 85, 0, 40}, each _ > 0)
{120, 85, 40}

Products that are teas

List.Select({"Green tea", "Coffee", "Black tea"}, each Text.EndsWith(_, "tea"))
{"Green tea", "Black tea"}

List.RemoveItems, List.FirstN, Table.SelectRows.

Last updated · OpenBI Studio 0.3.79