List.Select
ListReturns items from a list that match a condition.
Syntax
List.Select(list as list, selection as function) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list to filter. |
selection | function | Yes | A function that returns true for items to keep. |
Return Value
list — A list containing only the items that satisfy the condition.
Remarks
List.Select filters a list by applying a condition function to each item, returning only items where the function returns true. This is the list equivalent of Table.SelectRows.
Examples
Example 1: Select high prices
let
Prices = Table.Column(Products, "Price"),
HighPrices = List.Select(Prices, each _ > 30)
in
#table({"Price"}, List.Transform(HighPrices, each {_}))Result
Price | |
|---|---|
| 1 | 50 |
| 2 | 75 |
| 3 | 120 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks