Table.ExpandRecordColumn
Based on the input table's column of records, a new table will be generated with individual columns representing each field in the record. If desired, unique names for the columns in the new table can...
Table.ExpandRecordColumn(table as table, column as text, fieldNames as list, optional newColumnNames as nullable list) as table
Based on the input table's column of records, a new table will be generated with individual columns representing each field in the record. If desired, unique names for the columns in the new table can be provided using the newColumnNames parameter.
Parameters:
- table: The original table containing the record column to be expanded.
- column: The specific column to be expanded.
- fieldNames: The fields to be expanded into columns within the table.
- newColumnNames: The names to be assigned to the new columns. These names must be unique and cannot already exist in the new table.
To enhance the tabular format of the data, the column labeled [a] within the specified table ([a = [aa = 1, bb = 2, cc = 3], b = 2]) is to be expanded into separate columns named "aa," "bb," and "cc." This can be achieved using the Power Query MTable.ExpandRecordColumn function, which operates on a table created from records containing the original column [a].
The function will create new columns "aa," "bb," and "cc" and distribute the data accordingly. The resulting table will include these additional columns, preserving the existing column "b."