Power Query
published
Search
K
Comment on page

List.PositionOfAny

List.PositionOfAny

Returns the first offset of a value in a list.
function (list as list, values as list, optional occurrence as nullable any, optional equationCriteria as nullable any) as nullable any

Description

Returns the offset in list list of the first occurrence of a value in a list values. Returns -1 if no occurrence is found. An optional occurrence parameter occurrence can be specified.

Category

List.Membership functions

Examples

Find the first position in the list {1, 2, 3} at which the value 2 or 3 appears.
List.PositionOfAny({1, 2, 3}, {2, 3})
1