M Function Reference

A categorized reference of common Power Query M functions — table, text, list, date, and source functions — linking to full explanations where available.

M Function Reference

A quick-scan index of the M functions most commonly used in Power Query, grouped by category. Where a function is covered in depth elsewhere on this site — as part of a real transformation, merge, or troubleshooting example — the name links to it. Functions without a dedicated example get a one-line description here.


Table Functions

FunctionDescription
Table.SelectRowsFilters a table to rows matching a condition.
Table.RemoveColumnsDrops specified columns from a table.
Table.RenameColumnsRenames one or more columns.
Table.SelectColumnsReturns a table with only the specified columns, dropping the rest.
Table.TransformColumnTypesSets the data type of one or more columns.
Table.TransformColumnsApplies a function to every value in a column, transforming it in place.
Table.AddColumnAdds a new column, computed from an expression evaluated per row.
Table.AddIndexColumnAdds a sequential index column — the standard way to generate a surrogate key.
Table.GroupGroups rows and computes an aggregation per group, like SQL's GROUP BY.
Table.SortSorts a table by one or more columns.
Table.DistinctRemoves duplicate rows, optionally based on specific columns.
Table.RowCountReturns the number of rows in a table.
Table.FirstN / Table.SkipReturns the first N rows, or skips the first N rows.
Table.SplitColumnSplits one column into multiple columns, by delimiter or position.
Table.CombineColumnsMerges multiple columns into one, with a separator.
Table.Pivot / Table.UnpivotTurns row values into columns, or columns into rows.
Table.ReplaceValueReplaces specific values throughout a column.
Table.BufferLoads a table fully into memory, useful for stabilizing a source before repeated reads.

See Transformations for most of these applied to a real dataset, and Power Query Editor for how Applied Steps map directly to these function calls.


Merge & Combine Functions

FunctionDescription
Table.NestedJoinJoins two tables on matching columns, producing a column of nested tables.
Table.ExpandTableColumnExpands a nested-table column (typically from a merge) into regular columns.
Table.CombineStacks multiple tables with matching columns into one — the function behind Append Queries.
Table.NestedJoin (Left Anti)The same merge function, with a join kind that returns only unmatched rows — see Merge Queries.

Text Functions

FunctionDescription
Text.TrimRemoves leading and trailing whitespace.
Text.Upper / Text.LowerConverts text to uppercase or lowercase.
Text.Start / Text.End / Text.MiddleExtracts a substring from the start, end, or middle of a text value.
Text.SplitSplits a text value into a list, by delimiter.
Text.CombineJoins a list of text values into one, with a separator.
Text.ContainsReturns true if a text value contains a given substring.
Text.ReplaceReplaces all occurrences of a substring within a text value.
Text.LengthReturns the number of characters in a text value.

List Functions

FunctionDescription
List.SelectFilters a list to values matching a condition.
List.Sum / List.Average / List.CountAggregates the values in a list.
List.DistinctRemoves duplicate values from a list.
List.ContainsReturns true if a list contains a given value.
List.TransformApplies a function to every value in a list.
List.GenerateBuilds a list by repeatedly applying a function, useful for custom sequences.

Date & DateTime Functions

FunctionDescription
Date.FromConverts a value to a date.
DateTime.LocalNowReturns the current local date and time.
Date.Year / Date.Month / Date.DayExtracts the year, month, or day from a date.
Date.AddDays / Date.AddMonths / Date.AddYearsShifts a date by a given number of days, months, or years.
Duration.Days / Duration.TotalHoursExtracts a component from a duration value (the result of subtracting two dates/datetimes).

Number Functions

FunctionDescription
Number.RoundRounds a number to a specified number of decimal places.
Number.FromConverts a value (often text) to a number.
Number.ToTextConverts a number to text, optionally with a format string.

Type & Value Functions

FunctionDescription
Value.TypeReturns the type of a value — useful for debugging unexpected type errors.
Value.IsTests whether a value matches a given type.
Value.ReplaceTypeOverrides the declared type of a value without changing the value itself.

Error Handling

FunctionDescription
try ... otherwiseCatches an error from an expression, substituting a fallback value instead of failing the step.
errorExplicitly raises a custom error from within an expression.

Source & Connector Functions

FunctionDescription
Csv.DocumentParses CSV content into a table — the function behind Get Data > Text/CSV.
Excel.WorkbookReads an Excel file's sheets and tables.
Sql.DatabaseConnects to a SQL Server database.
Json.DocumentParses JSON content into a record or list.
Web.ContentsFetches raw content from a URL — the basis of most API-based connectors.
File.ContentsReads the raw binary contents of a local file.

See M Language for how these source functions typically appear as the first step (Source =) in a generated query.


How to Use This Reference

  • Linked functions are shown applied to a real, worked example elsewhere on this site — not just a syntax definition.
  • Unlinked functions are simple enough that a one-line description is sufficient — Microsoft's own Power Query M function reference covers full parameter lists for anything not detailed here.
  • Start with Introduction and M Language if the underlying syntax (the let...in structure, each, referencing previous steps) isn't yet familiar — the function list assumes those concepts.

Next Steps

Continue learning Power Query: