Table.PrefixColumns
Puts a prefix and a dot in front of every column name.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.PrefixColumns(table as table, prefix as text) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table whose columns get the prefix. |
prefix | text | The text to put in front; a dot comes between it and each name. |
Returns
table. The same rows, each column renamed prefix.name.
Remarks
- Handy before two tables with the same column names (Id, Name) are combined side by side.
Examples
Product columns, marked as such
Table.PrefixColumns(#table({"Id", "Name"}, {{1, "Chair"}, {2, "Desk"}}), "Product")
| Product.Id | Product.Name |
|---|---|
| 1 | Chair |
| 2 | Desk |
Related functions
Table.TransformColumnNames, Table.RenameColumns, Table.ExpandTableColumn.