List.Positions

Updated on

List.Positions is a Power Query M function that returns a list of offsets for an input list. The function returns a list of positions, which can be used to give the transform access to the position when using List.Transform.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

List.Positions( list as list ) as list

Description

Returns a list of offsets for the input list list. When using List.Transform to change a list, the list of positions can be used to give the transform access to the position.

Examples

Find the offsets of values in the list {1, 2, 3, 4, null, 5}.

// Output: {0, 1, 2, 3, 4, 5}
List.Positions( {1, 2, 3, 4, null, 5} )

Learn more about List.Positions in the following articles:

Other functions related to List.Positions are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/list-positions