Table Functions Overview

Updated on

Examine Table Functions in Power Query M Language, essential for creating and manipulating tables. This page provides a comprehensive list and descriptions of Table Functions available in the M Language.

Table of contents

Table Creation and Conversion

FunctionDescription
#tableCreates a table value from columns and rows.
ItemExpression.FromReturns the abstract syntax tree (AST) for the body of a function.
ItemExpression.ItemAn abstract syntax tree (AST) node representing the item in an item expression.
RowExpression.ColumnReturns an abstract syntax tree (AST) that represents access to a column within a row expression.
RowExpression.FromReturns the abstract syntax tree (AST) for the body of a function.
RowExpression.RowAn abstract syntax tree (AST) node representing the row in a row expression.
Table.CombineReturns a table that is the result of merging a list of tables.
Table.FromColumnsCreates a table from a list of columns and specified values.
Table.FromListConverts a list into a table by applying the specified splitting function to each item in the list.
Table.FromPartitionsReturns a table that is the result of combining a set of partitioned tables.
Table.FromRecordsConverts a list of records into a table.
Table.FromRowsCreates a table from a list of row values and optional columns
Table.FromValueCreates a table with a column from the provided value(s).
Table.PartitionPartitions the table into a list of tables based on the number of groups and column specified.
Table.PartitionValuesReturns information about how a table is partitioned.
Table.SplitSplits the specified table into a list of tables using the specified page size.
Table.SplitAtReturns a list containing the first count rows specified and the remaining rows.
Table.ToColumnsCreates a list of nested lists of column values from a table.
Table.ToListConverts a table into a list by applying the specified combining function to each row of values in the table.
Table.ToRecordsConverts a table to a list of records.
Table.ToRowsCreates a list of nested lists of row values from a table.

Information Functions

FunctionDescription
Table.ApproximateRowCountReturns the approximate number of rows in the table.
Table.ColumnCountReturns the number of columns in the table.
Table.ContainsIndicates whether the specified record appears as a row in the table.
Table.ContainsAllIndicates whether all of the specified records appear as rows in the table.
Table.ContainsAnyIndicates whether any of the specified records appear as rows in the table.
Table.FindTextReturns all the rows that contain the given text in the table.
Table.HasColumnsIndicates whether the table contains the specified column(s).
Table.IsDistinctIndicates whether the table contains only distinct rows (no duplicates).
Table.IsEmptyIndicates whether the table contains any rows.
Table.MatchesAllRowsIndicates whether all the rows in the table meet the given condition.
Table.MatchesAnyRowsIndicates whether any the rows in the table meet the given condition.
Table.PositionOfReturns the position or positions of the row within the table.
Table.PositionOfAnyReturns the position or positions of any of the specified rows within the table.
Table.ProfileReturns a profile of the columns of a table.
Table.RowCountReturns the number of rows in the table.
Table.SchemaReturns a table containing a description of the columns (i.e
Tables.GetRelationshipsGets the relationships among a set of tables.

Column Operations

Add and Expand Columns

FunctionDescription
Table.AddColumnAdds a column with the specified name
Table.AddIndexColumnAppends a column with explicit position values.
Table.AddRankColumnAppends a column with the ranking of one or more other columns.
Table.DuplicateColumnDuplicates a column with the specified name
Table.ExpandListColumnGiven a column of lists in a table, create a copy of a row for each value in its list.
Table.ExpandRecordColumnExpands a column of records into columns with each of the values.
Table.ExpandTableColumnExpands a column of records or a column of tables into multiple columns in the containing table.

Column Header Manipulation

FunctionDescription
Table.ColumnNamesReturns the column names as a list.
Table.ColumnsOfTypeReturns a list with the names of the columns that match the specified types.
Table.DemoteHeadersDemotes the column headers to the first row of values.
Table.PromoteHeadersPromotes the first row of values as the new column headers (i.e
Table.TransformColumnNamesTransforms column names by using the given function.

Joining Columns

FunctionDescription
Table.AddFuzzyClusterColumnAdds a new column with representative values obtained by fuzzy grouping values of the specified column in the table.
Table.AddJoinColumnPerforms a join between tables on supplied columns and produces the join result in a new column.
Table.FuzzyJoinJoins the rows from the two tables that fuzzy match based on the given keys.
Table.FuzzyNestedJoinPerforms a fuzzy join between tables on supplied columns and produces the join result in a new column.
Table.JoinJoins the rows from the two tables that match based on the given keys.
Table.NestedJoinPerforms a join between tables on supplied columns and produces the join result in a new column.

Selecting and Ordering Columns

FunctionDescription
Table.ColumnReturns a specified column of data from the table as a list.
Table.RemoveColumnsRemoves the specified columns.
Table.ReorderColumnsReturns a table with the columns in the specified order.
Table.SelectColumnsReturns a table with only the specified columns.

Transform Columns

FunctionDescription
Table.AddKeyAdds a key to a table.
Table.CombineColumnsCombines the specified columns into a new column using the specified combiner function.
Table.CombineColumnsToRecordCombines the specified columns into a new record-valued column where each record has field names and values corresponding to the column names and values of the columns that were combined.
Table.KeysReturns the keys of the specified table.
Table.PivotGiven a pair of columns representing attribute-value pairs, rotates the data in the attribute column into a column headings.
Table.PrefixColumnsReturns a table where the columns have all been prefixed with the given text.
Table.ReplaceKeysReplaces the keys of the specified table.
Table.SplitColumnSplits the specified columns into a set of additional columns using the specified splitter function.
Table.TransformColumnTypesApplies type transformation(s) of the form { column, type } using a specific culture.
Table.TransformColumnsTransforms the values of one or more columns.
Table.TransformRowsTransforms the rows of the table using the specified transform function.
Table.UnpivotTranslates a set of columns in a table into attribute-value pairs.
Table.UnpivotOtherColumnsTranslates all columns other than a specified set into attribute-value pairs.

Row Operations

Adding or Removing Rows

FunctionDescription
Table.AlternateRowsKeeps the initial offset then alternates taking and skipping the following rows.
Table.DistinctRemoves duplicate rows from the table.
Table.InsertRowsInserts a list of rows into the table at the specified position.
Table.RangeReturns the rows beginning at the specified offset.
Table.RemoveFirstNReturns a table with the first count rows skipped.
Table.RemoveLastNReturns a table with the last N rows removed.
Table.RemoveMatchingRowsRemoves all occurrences of the specified rows from the table.
Table.RemoveRowsRemoves the specified number of rows.
Table.RepeatRepeats the rows of the tables a specified number of times.
Table.SkipReturns a table with the first count rows skipped.

Selecting and Ordering Rows

FunctionDescription
Table.FilterWithDataTableThis function is intended for internal use only.
Table.FirstReturns the first row or a specified default value.
Table.FirstNReturns the first count rows specified.
Table.FirstValueReturns the first column of the first row of the table or a specified default value.
Table.LastReturns the last row or a specified default value.
Table.LastNReturns the last specified number of rows.
Table.MaxReturns the largest row or default value using the given criteria.
Table.MaxNReturns the largest row(s) using the given criteria.
Table.MinReturns the smallest row or a default value using the given criteria.
Table.MinNReturns the smallest row(s) using the given criteria.
Table.RemoveRowsWithErrorsReturns a table with the rows removed from the input table that contain an error in at least one of the cells
Table.ReverseRowsReturns a table with the rows in reverse order.
Table.SelectRowsSelects the rows that meet the condition function.
Table.SelectRowsWithErrorsReturns a table with only those rows of the input table that contain an error in at least one of the cells
Table.SingleRowReturns the single row in the table.
Table.SortSorts the table using one or more column names and comparison criteria.

Transforming Rows

FunctionDescription
Table.AggregateTableColumnAggregates a column of tables into multiple columns in the containing table.
Table.FillDownPropagates the value of a previous cell to the null-valued cells below in the column.
Table.FillUpPropagates the value of a cell to the null-valued cells above in the column.
Table.FuzzyGroupGroups rows in the table based on fuzzy matching of keys.
Table.GroupGroups rows in the table that have the same key.
Table.RenameColumnsApplies rename(s) of the form {old, new}.
Table.ReplaceErrorValuesReplaces the error values in the specified columns with the corresponding specified value.
Table.ReplaceMatchingRowsReplaces all the specified rows with the provided row(s).
Table.ReplaceRowsReplaces the specified range of rows with the provided row(s).
Table.ReplaceValueReplaces one value with another in the specified columns.
Table.TransposeMakes columns into rows and rows into columns.

Other Table Functions

FunctionDescription
Table.BufferBuffers a table in memory, isolating it from external changes during evaluation.
Table.ConformToPageReaderThis function is intended for internal use only.
Table.ReplaceRelationshipIdentityThis function is intended for internal use only.
Table.StopFoldingPrevents any downstream operations from being run against the original source of the data.
Table.ViewCreates or extends a table with user-defined handlers for query and action operations.
Table.ViewErrorCreates a modified error record which won’t trigger a fallback when thrown by a handler defined on a view (via Table.View).
Table.ViewFunctionCreates a function that can be intercepted by a handler defined on a view (via Table.View).

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

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