List functions - PowerQuery M (2024)

  • Article

These functions create and manipulate list values.

Information

NameDescription
List.CountReturns the number of items in a list.
List.NonNullCountReturns the number of items in a list excluding null values
List.IsEmptyReturns whether a list is empty.

Selection

NameDescription
List.AlternateReturns a list with the items alternated from the original list based on a count, optional repeatInterval, and an optional offset.
List.BufferBuffers the list in memory. The result of this call is a stable list, which means it will have a determinimic count, and order of items.
List.DistinctFilters a list down by removing duplicates. An optional equation criteria value can be specified to control equality comparison. The first value from each equality group is chosen.
List.FindTextSearches a list of values, including record fields, for a text value.
List.FirstReturns the first value of the list or the specified default if empty. Returns the first item in the list, or the optional default value, if the list is empty. If the list is empty and a default value is not specified, the function returns.
List.FirstNReturns the first set of items in the list by specifying how many items to return or a qualifying condition provided by countOrCondition.
List.InsertRangeInserts items from values at the given index in the input list.
List.IsDistinctReturns whether a list is distinct.
List.LastReturns the last set of items in the list by specifying how many items to return or a qualifying condition provided by countOrCondition.
List.LastNReturns the last set of items in a list by specifying how many items to return or a qualifying condition.
List.MatchesAllReturns true if all items in a list meet a condition.
List.MatchesAnyReturns true if any item in a list meets a condition.
List.PositionsReturns a list of positions for an input list.
List.RangeReturns a count items starting at an offset.
List.SelectSelects the items that match a condition.
List.SingleReturns the single item of the list or throws an Expression.Error if the list has more than one item.
List.SingleOrDefaultReturns a single item from a list.
List.SkipSkips the first item of the list. Given an empty list, it returns an empty list. This function takes an optional parameter countOrCondition to support skipping multiple values.

Transformation functions

NameDescription
List.AccumulateAccumulates a result from the list. Starting from the initial value seed this function applies the accumulator function and returns the final result.
List.CombineMerges a list of lists into single list.
List.ConformToPageReaderThis function is intended for internal use only.
List.RemoveRangeReturns a list that removes count items starting at offset. The default count is 1.
List.RemoveFirstNReturns a list with the specified number of elements removed from the list starting at the first element. The number of elements removed depends on the optional countOrCondition parameter.
List.RemoveItemsRemoves items from list1 that are present in list2, and returns a new list.
List.RemoveLastNReturns a list with the specified number of elements removed from the list starting at the last element. The number of elements removed depends on the optional countOrCondition parameter.
List.RepeatReturns a list that repeats the contents of an input list count times.
List.ReplaceRangeReturns a list that replaces count values in a list with a replaceWith list starting at an index.
List.RemoveMatchingItemsRemoves all occurrences of the given values in the list.
List.RemoveNullsRemoves null values from a list.
List.ReplaceMatchingItemsReplaces occurrences of existing values in the list with new values using the provided equationCriteria. Old and new values are provided by the replacements parameters. An optional equation criteria value can be specified to control equality comparisons. For details of replacement operations and equation criteria, go to Parameter values.
List.ReplaceValueSearches a list of values for the value and replaces each occurrence with the replacement value.
List.ReverseReturns a list that reverses the items in a list.
List.SplitSplits the specified list into a list of lists using the specified page size.
List.TransformPerforms the function on each item in the list and returns the new list.
List.TransformManyReturns a list whose elements are projected from the input list.

Membership functions

Since all values can be tested for equality, these functions can operate over heterogeneous lists.

NameDescription
List.AllTrueReturns true if all expressions in a list are true
List.AnyTrueReturns true if any expression in a list in true
List.ContainsReturns true if a value is found in a list.
List.ContainsAllReturns true if all items in values are found in a list.
List.ContainsAnyReturns true if any item in values is found in a list.
List.PositionOfFinds the first occurrence of a value in a list and returns its position.
List.PositionOfAnyFinds the first occurrence of any value in values and returns its position.

Set operations

NameDescription
List.DifferenceReturns the items in list 1 that do not appear in list 2. Duplicate values are supported.
List.IntersectReturns a list from a list of lists and intersects common items in individual lists. Duplicate values are supported.
List.UnionReturns a list from a list of lists and unions the items in the individual lists. The returned list contains all items in any input lists. Duplicate values are matched as part of the Union.
List.ZipReturns a list of lists combining items at the same position.

Ordering

Ordering functions perform comparisons. All values that are compared must be comparable with each other. This means they must all come from the same datatype (or include null, which always compares smallest). Otherwise, an Expression.Error is thrown.

Comparable data types include:

  • Number
  • Duration
  • DateTime
  • Text
  • Logical
  • Null
NameDescription
List.MaxReturns the maximum item in a list, or the optional default value if the list is empty.
List.MaxNReturns the maximum values in the list. The number of values to return or a filtering condition must be specified.
List.MedianReturns the median item from a list.
List.MinReturns the minimum item in a list, or the optional default value if the list is empty.
List.MinNReturns the minimum values in a list. The number of values to return or a filtering condition may be specified.
List.SortReturns a sorted list using comparison criterion.
List.PercentileReturns one or more sample percentiles corresponding to the given probabilities.

Averages

These functions operate over hom*ogeneous lists of Numbers, DateTimes, and Durations.

NameDescription
List.AverageReturns an average value from a list in the datatype of the values in the list.
List.ModeReturns an item that appears most commonly in a list.
List.ModesReturns all items that appear with the same maximum frequency.
List.StandardDeviationReturns the standard deviation from a list of values. List.StandardDeviation performs a sample based estimate. The result is a number for numbers, and a duration for DateTimes and Durations.

Addition

These functions work over hom*ogeneous lists of Numbers or Durations.

NameDescription
List.SumReturns the sum from a list.

Numerics

These functions only work over numbers.

NameDescription
List.CovarianceReturns the covariance from two lists as a number.
List.ProductReturns the product from a list of numbers.

Generators

These functions generate list of values.

NameDescription
List.DatesReturns a list of date values from size count, starting at start and adds an increment to every value.
List.DateTimesReturns a list of datetime values from size count, starting at start and adds an increment to every value.
List.DateTimeZonesReturns a list of of datetimezone values from size count, starting at start and adds an increment to every value.
List.DurationsReturns a list of durations values from size count, starting at start and adds an increment to every value.
List.GenerateGenerates a list of values.
List.NumbersReturns a list of numbers from size count starting at initial, and adds an increment. The increment defaults to 1.
List.RandomReturns a list of count random numbers, with an optional seed parameter.
List.TimesReturns a list of time values of size count, starting at start.

Parameter values

Occurrence specification

  • Occurrence.First = 0;
  • Occurrence.Last = 1;
  • Occurrence.All = 2;

Sort order

  • Order.Ascending = 0;
  • Order.Descending = 1;

Equation criteria

Equation criteria for list values can be specified as either:

  • A function value that is either:
    • A key selector that determines the value in the list to apply the equality criteria.
    • A comparer function that is used to specify the kind of comparison to apply. Built in comparer functions can be specified—go to Comparer functions.
  • A list value that has:
    • Exactly two items.
    • The first element is the key selector as specified above.
    • The second element is a comparer as specified above.

For more information and examples, go to List.Distinct.

Comparison criteria

Comparison criterion can be provided as either of the following values:

  • A number value to specify a sort order. For more information, go to Sort order.
  • To compute a key to be used for sorting, a function of one argument can be used.
  • To both select a key and control order, comparison criterion can be a list containing the key and order.
  • To completely control the comparison, a function of two arguments can be used that returns -1, 0, or 1 given the relationship between the left and right inputs. Value.Compare is a method that can be used to delegate this logic.

For more information and examples, go to List.Sort.

Replacement operations

Replacement operations are specified by a list value. Each item of this list must be:

  • A list value of exactly two items.
  • First item is the old value in the list, to be replaced.
  • Second item is the new value, which should replace all occurrences of the old value in the list.
List functions - PowerQuery M (2024)
Top Articles
Mikayla Campinos: Where To Find Leaks And More
Where To Find Mikayla Campinos' Leaked Files
Tripadvisor Antigua Forum
LOST JEEPS • View forum
Gilbert Public Schools Infinite Campus
No Hard Feelings Showtimes Near Metropolitan Fiesta 5 Theatre
Your Blog - Sheri Blonde
Best Pre Med Schools U.s. News
Barbara Roufs Measurements
Aita For Helping My Girlfriend Get Over Her Trauma
Valentina Gonzalez Leak
Finger Lakes 1 Police Beat
Mannat Indian Grocers
My Scheduler Hca Cloud
Wow Patchu Pet Battle
Ofw Pinoy Channel Su
Chula Vista Tv Listings
How Much Is Felipe Valls Worth
Baca's Funeral Chapels & Sunset Crematory Las Cruces Obituaries
Tamilyogi. Vip
Dominion Post Obituaries Morgantown
How to Be an Extra in a Movie (and What to Expect)
Dimbleby Funeral Home
Hannaford Weekly Flyer Manchester Nh
Eros Indy
Uganda: The tiny flea making it painful for people to walk and work | African Arguments
Craigslist Vt Heavy Equipment - Craigslist Near You
Funny Marco Birth Chart
Maven 5X30 Scope
Gopher Hockey Forum
Bella Poarch Dazzles in Recent Beach Photos, Hits 1 Million Instagram Likes - Magzica
South Park Old Fashioned Gif
Sport & Fitness in Hainbuch: Zubehör & Ausrüstung günstig kaufen
100X35 Puerto Rico Meaning
Hispanic supermarket chain Sedano's now delivering groceries in Orlando
Jackandjill Pregnant
Adaptibar Vs Uworld
Miracle Child Brandon Lake Chords
Retro Bowl Unblocked Game 911: A Complete Guide - Unigamesity
Comcast Business Downdetector
DePaul joins nationwide pro-Palestinian college protests as encampment continues at University of Chicago
Game On Classroom 6X
Moviesverse 2023
Vitamin-K-Lebensmittel – diese enthalten am meisten! | eatbetter: gesunde, einfache Rezepte & Tipps für jeden Tag
Pokeclicker Pikablu
Skip The Games Mil
1636 Fire Red Squirrels
Ebony Grinding Lesbian
Farmers And Merchants Bank Broadway Va
Mileage To Walmart
Chase Bank Time Hours
Navy Qrs Supervisor Answers
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 6403

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.