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

Table.Unpivot

Owen Duncan|Last Updated: 4/19/2018

About

Given a list of table columns, transforms those columns into attribute-value pairs.

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

Arguments

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

Remarks

  • The transformation is patterned after the SQL UNPIVOT operator.

Examples

Table.Unpivot(Table.FromRecords({  

    [ key = "key1", attribute1 = 1, attribute2 = null, attribute3 = 3 ]}),  

    { "attribute1", "attribute2", "attribute3" }, "attribute", "value")  
keyattributevalue
key1attribute11
key1attribute33
© 2018 Microsoft