Table.DuplicateColumn

Copy the column with the name "columnName" to the table named "table." The values and data type for the new column, which will be named "newColumnName," will be an exact replica of the original column...

Syntax

Table.DuplicateColumn(table as table, columnName as text, newColumnName as text, optional columnType as nullable type) as table

About

Copy the column with the name "columnName" to the table named "table." The values and data type for the new column, which will be named "newColumnName," will be an exact replica of the original column "columnName."

Explanation

Replicate the data in column "a" into a new column named "copied column" within the table ({[a = 1, b = 2], [a = 3, b = 4]}). This can be done using the Power Query MTable function DuplicateColumn. The syntax for this operation is as follows: Table.FromRecords({ [a = 1, b = 2], [a = 3, b = 4] }).DuplicateColumn( "a", "copied column" ) The resulting output will be: Table.FromRecords({ [a = 1, b = 2, #"copied column" = 1], [a = 3, b = 4, #"copied column" = 3] })