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
Function Description Input Output List.Accumulate Accumulates a summary value from the items in the list. List Any List.DateTimeZones Generates a list of datetimezone values given an initial value, count, and incremental duration value. Datetimezone List List.DateTimes Generates a list of datetime values given an initial value, count, and incremental duration value. Datetime List List.Dates Generates a list of date values given an initial value, count, and incremental duration value. Date List List.Durations Generates a list of duration values given an initial value, count, and incremental duration value. Duration List List.Generate Generates a list of values. Function List List.Numbers Returns a list of numbers given an initial value, count, and optional increment value. Number List List.Random Returns a list of random numbers. Number List List.Repeat Returns a list that is count repetitions of the original list. List List List.Times Generates a list of time values given an initial value, count, and incremental duration value. Time List
Function Description Input Output List.AllTrue Returns true if all expressions are true. List Logical List.AnyTrue Returns true if any expression is true. List Logical List.Contains Indicates whether the list contains the value. List Logical List.ContainsAll Indicates where a list includes all the values in another list. List Logical List.ContainsAny Indicates where a list includes any of the values in another list. List Logical List.IsDistinct Indicates whether there are duplicates in the list. List Logical List.IsEmpty Returns true if the list is empty. List Logical List.MatchesAll Returns true if the condition function is satisfied by all values in the list. List Logical List.MatchesAny Returns true if the condition function is satisfied by any value. List Logical List.PositionOf Returns the offset(s) of a value in a list. List Any List.PositionOfAny Returns the first offset of a value in a list. List Any List.Positions Returns a list of offsets for the input. List List
Selection Functions
Function Description Input Output List.Alternate Returns a list comprised of all the odd numbered offset elements in a list. List List List.Buffer Buffers a list. List List List.FindText Returns a list of values (including record fields) that contain the specified text. List List List.First Returns the first value of the list or the specified default if empty. List Any List.FirstN Returns the first set of items in the list by specifying how many items to return or a qualifying condition. List Any List.Last Returns the last value of the list or the specified default if empty. List Any List.LastN Returns the last value in the list List Any List.Max Returns the maximum value or the default value for an empty list. List Any List.MaxN Returns the maximum value(s) in the list List List List.Min Returns the minimum value or the default value for an empty list. List Any List.MinN Returns the minimum value(s) in the list List List List.Range Returns a subset of the list beginning at an offset. List List List.Select Returns a list of values that match the condition. List List List.Single Returns the one list item for a list of length one, otherwise throws an exception. List Any List.SingleOrDefault Returns the one list item for a list of length one and the default value for an empty list. List Any
Statistical Functions
Function Description Input Output List.Average Returns the average of the values List Any List.Count Returns the number of items in the list. List Number List.Covariance Returns the covariance between the two lists of numbers. List Number List.Median Returns the median value in the list. List Any List.Mode Returns the most frequent value in the list. List Any List.Modes Returns a list of the most frequent values in the list. List List List.NonNullCount Returns the number of non-null items in the list. List Number List.Percentile Returns one or more sample percentiles corresponding to the given probabilities. List Any List.Product Returns the product of the numbers in the list. List Number List.StandardDeviation Returns a sample based estimate of the standard deviation. List Number List.Sum Returns the sum of the items in the list. List Any
Function Description Input Output List.Combine Returns a single list by combining multiple lists. List List List.ConformToPageReader This function is intended for internal use only. List Table List.Difference Returns the difference of the two given lists. List List List.Distinct Returns a list of values with duplicates removed. List List List.InsertRange Inserts values into a list at the given index. List List List.Intersect Returns the intersection of the list values found in the input. List List List.RemoveFirstN Returns a list that skips the specified number of elements at the beginning of the list. List List List.RemoveItems Removes items from list1 that are present in list. List List List.RemoveLastN Returns a list that removes the specified number of elements from the end of the list. List List List.RemoveMatchingItems Removes all occurrences of the input values. List List List.RemoveNulls Removes all “null” values from the specified list. List List List.RemoveRange Removes count number of values starting at the specified position. List List List.ReplaceMatchingItems Applies each replacement of { old, new }. List List List.ReplaceRange Replaces count number of values starting at position with the replacement values. List List List.ReplaceValue Searches a list for the specified value and replaces it. List List List.Reverse Reverses the order of values in the list. List List List.Skip Returns a list that skips the specified number of elements at the beginning of the list. List List List.Sort Sorts a list of data according to the criteria specified. List List List.Split Splits the specified list into a list of lists using the specified page size. List List List.Transform Returns a new list of values computed from this list. List List List.TransformMany Returns a list whose elements are transformed from the input list using specified functions. List List List.Union Returns the union of the list values found in the input. List List List.Zip Returns a list of lists by combining items at the same position in multiple lists. List List