M function reference
The functions you'll use most, explained with a small example. Every example's output on these pages is produced by running it, not typed by hand.
Table functions
Table.SelectRowsKeeps the rows for which a condition is true.Table.SelectColumnsKeeps the listed columns, in the listed order.Table.RemoveColumnsRemoves the listed columns and keeps everything else.Table.RenameColumnsRenames columns from a list of {old, new} pairs.Table.ReorderColumnsPuts columns in a new order.Table.SortSorts rows by one or more columns.Table.FirstNKeeps the first N rows, or the leading rows while a condition holds.Table.DistinctRemoves duplicate rows, optionally comparing only some columns.Table.AddColumnAdds a column calculated from each row.Table.GroupGroups rows by key columns and aggregates each group.Table.NestedJoinJoins two tables and puts matches in a nested table column.Table.ExpandTableColumnExpands a nested table column into columns (and rows).Table.CombineAppends a list of tables, matching columns by name.Table.UnpivotOtherColumnsTurns all columns except the listed ones into attribute/value rows.Table.PivotTurns values of one column into new columns.Table.FillDownReplaces nulls with the value above.Table.TransformColumnTypesConverts columns to types, optionally with a culture.Table.TransformColumnsApplies a function to every value in chosen columns.Table.ReplaceValueReplaces values in chosen columns.Table.SplitColumnSplits a column into several using a splitter function.Table.AddIndexColumnAdds a running number to each row.Table.RemoveRowsWithErrorsRemoves rows that have an error in given columns.Table.ReplaceErrorValuesReplaces errors in columns with a value.Table.PromoteHeadersUses the first row as column names.Table.SkipSkips the first N rows, or leading rows while a condition holds.Table.TransformColumnNamesApplies a function to every column name.
Text functions
Text.TrimRemoves leading and trailing whitespace.Text.ProperCapitalises the first letter of each word.Text.BeforeDelimiterReturns the text before a delimiter.Text.AfterDelimiterReturns the text after a delimiter.Text.ContainsTests whether text contains a substring.Text.PadStartPads text on the left to a given length.