Table.PrefixColumns
TablePrefixes all column names in a table with a given text value.
Syntax
Table.PrefixColumns(table as table, prefix as text) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The input table whose columns to prefix. |
prefix | text | Yes | The text to prepend to each column name, followed by a period separator. |
Return Value
table — A table with all column names prefixed by the specified text, separated by a period.
Remarks
Table.PrefixColumns renames every column in a table by adding a prefix followed by a period (e.g., "Sales" turns "Product" into "Sales.Product"). This is useful before combining or joining tables to avoid column name collisions — particularly when two tables share the same column names.
Examples
Example 1: Prefix column names
Table.PrefixColumns(
Table.SelectColumns(Table.FirstN(Sales, 2), {"OrderID", "Product", "Region"}),
"Sales"
)Result
Sales.OrderID | Sales.Product | Sales.Region | |
|---|---|---|---|
| 1 | 1 | Widget A | East |
| 2 | 2 | Gadget B | West |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks