Table.DemoteHeaders

语法

Table.DemoteHeaders(table as table) as table

关于

将列标题(即列名称)降级为值的第一行。 默认列名称为“Column1”、“Column2”等。

示例 1

降级表中的第一行值。

使用情况

Table.DemoteHeaders(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"]
    })
)

输出

Table.FromRecords({
    [Column1 = "CustomerID", Column2 = "Name", Column3 = "Phone"],
    [Column1 = 1, Column2 = "Bob", Column3 = "123-4567"],
    [Column1 = 2, Column2 = "Jim", Column3 = "987-6543"]
})