List Functions Overview

Updated on

Learn about List Functions in Power Query M Language, crucial when working with lists in your data manipulation tasks. This page provides a comprehensive list and descriptions of List Functions available in the M Language.

Table of contents

Generator Functions

FunctionDescription
List.AccumulateAccumulates a summary value from the items in the list.
List.DateTimeZonesGenerates a list of datetimezone values given an initial value, count, and incremental duration value.
List.DateTimesGenerates a list of datetime values given an initial value, count, and incremental duration value.
List.DatesGenerates a list of date values given an initial value, count, and incremental duration value.
List.DurationsGenerates a list of duration values given an initial value, count, and incremental duration value.
List.GenerateGenerates a list of values.
List.NumbersReturns a list of numbers given an initial value, count, and optional increment value.
List.RandomReturns a list of random numbers.
List.RepeatReturns a list that is count repetitions of the original list.
List.TimesGenerates a list of time values given an initial value, count, and incremental duration value.

Information Functions

FunctionDescription
List.AllTrueReturns true if all expressions are true.
List.AnyTrueReturns true if any expression is true.
List.ContainsIndicates whether the list contains the value.
List.ContainsAllIndicates where a list includes all the values in another list.
List.ContainsAnyIndicates where a list includes any of the values in another list.
List.IsDistinctIndicates whether there are duplicates in the list.
List.IsEmptyReturns true if the list is empty.
List.MatchesAllReturns true if the condition function is satisfied by all values in the list.
List.MatchesAnyReturns true if the condition function is satisfied by any value.
List.PositionOfReturns the offset(s) of a value in a list.
List.PositionOfAnyReturns the first offset of a value in a list.
List.PositionsReturns a list of offsets for the input.

Selection Functions

FunctionDescription
List.AlternateReturns a list comprised of all the odd numbered offset elements in a list.
List.BufferBuffers a list.
List.FindTextReturns a list of values (including record fields) that contain the specified text.
List.FirstReturns the first value of the list or the specified default if empty.
List.FirstNReturns the first set of items in the list by specifying how many items to return or a qualifying condition.
List.LastReturns the last value of the list or the specified default if empty.
List.LastNReturns the last value in the list
List.MaxReturns the maximum value or the default value for an empty list.
List.MaxNReturns the maximum value(s) in the list
List.MinReturns the minimum value or the default value for an empty list.
List.MinNReturns the minimum value(s) in the list
List.RangeReturns a subset of the list beginning at an offset.
List.SelectReturns a list of values that match the condition.
List.SingleReturns the one list item for a list of length one, otherwise throws an exception.
List.SingleOrDefaultReturns the one list item for a list of length one and the default value for an empty list.

Statistical Functions

FunctionDescription
List.AverageReturns the average of the values
List.CountReturns the number of items in the list.
List.CovarianceReturns the covariance between the two lists of numbers.
List.MedianReturns the median value in the list.
List.ModeReturns the most frequent value in the list.
List.ModesReturns a list of the most frequent values in the list.
List.NonNullCountReturns the number of non-null items in the list.
List.PercentileReturns one or more sample percentiles corresponding to the given probabilities.
List.ProductReturns the product of the numbers in the list.
List.StandardDeviationReturns a sample based estimate of the standard deviation.
List.SumReturns the sum of the items in the list.

Transformation Functions

FunctionDescription
List.CombineReturns a single list by combining multiple lists.
List.ConformToPageReaderThis function is intended for internal use only.
List.DifferenceReturns the difference of the two given lists.
List.DistinctReturns a list of values with duplicates removed.
List.InsertRangeInserts values into a list at the given index.
List.IntersectReturns the intersection of the list values found in the input.
List.RemoveFirstNReturns a list that skips the specified number of elements at the beginning of the list.
List.RemoveItemsRemoves items from list1 that are present in list.
List.RemoveLastNReturns a list that removes the specified number of elements from the end of the list.
List.RemoveMatchingItemsRemoves all occurrences of the input values.
List.RemoveNullsRemoves all “null” values from the specified list.
List.RemoveRangeRemoves count number of values starting at the specified position.
List.ReplaceMatchingItemsApplies each replacement of { old, new }.
List.ReplaceRangeReplaces count number of values starting at position with the replacement values.
List.ReplaceValueSearches a list for the specified value and replaces it.
List.ReverseReverses the order of values in the list.
List.SkipReturns a list that skips the specified number of elements at the beginning of the list.
List.SortSorts a list of data according to the criteria specified.
List.SplitSplits the specified list into a list of lists using the specified page size.
List.TransformReturns a new list of values computed from this list.
List.TransformManyReturns a list whose elements are transformed from the input list using specified functions.
List.UnionReturns the union of the list values found in the input.
List.ZipReturns a list of lists by combining items at the same position in multiple lists.

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

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy