Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.UnpivotOtherColumns

Owen Duncan|Last Updated: 4/19/2018

About

Translates all columns other than a specified set into attribute-value pairs, combined with the rest of the values in each row.

Table.UnpivotOtherColumns(table as table, pivotColumns as list, attributeColumn as text,  valueColumn as text) as table  

Arguments

ArgumentDescription
tableThe Table to modify.
pivotColumnsThe columns to skip transformation.
attributeColumnThe column to make the attribute.
valueColumnThe column to make the value.

Remarks

  • The transformation is patterned after the SQL UNPIVOT operator.

Example

Table.UnpivotOtherColumns(Table.FromRecords({   [ key = "key1", attribute1 = 1, attribute2 = 2, attribute3 = 3 ],   [ key = "key2", attribute1 = 4, attribute2 = 5, attribute3 = 6 ]  }), { "key" }, "column1", "column2")  
keycolumn1column2
key1attribute11
key1attribute22
key1attribute33
key2attribute14
key2attribute25
key2attribute36
© 2018 Microsoft