List.PositionOf

This function will provide the position of a specific value within a given list. If the value is not found, it will return -1. Additionally, users can input an optional parameter 'occurrence' to speci...

Syntax

List.PositionOf(list as list, value as any, optional occurrence as nullable number, optional equationCriteria as any) as any

About

This function will provide the position of a specific value within a given list. If the value is not found, it will return -1. Additionally, users can input an optional parameter 'occurrence' to specify the maximum number of times the value should be reported in the list.

Explanation

Determine the index of the value 3 in the list {1, 2, 3}. Use the Power Query function MList.PositionOf({1, 2, 3}, 3). The output will be 2.