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} )
Related articles
Learn more about List.Positions in the following articles:
- Remove List Items by Positions in Power Query
This article shows how you can remove items from a list by their index position by using a custom function. » Read more - 3 Ways to Select List Items by Position in Power Query
This article explores 3 different ways to select multiple items in your list by index position. » Read more
Related functions
Other functions related to List.Positions are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy