Table.PrefixColumns

Table

Prefixes all column names in a table with a given text value.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.PrefixColumns(table as table, prefix as text) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe input table whose columns to prefix.
prefixtextYesThe text to prepend to each column name, followed by a period separator.

Return Value

tableA 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
11Widget AEast
22Gadget BWest

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks