Table.ExpandListColumn

Table.ExpandListColumn is a Power Query M function that splits a column containing lists into separate rows for each value, duplicating other column values in each new row. The function returns a new table with expanded rows.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Table.ExpandListColumn(
   table as table,
   column as text,
) as table

Description

Given a table, where a column is a list of values, splits the list into a row for each value. Values in the other columns are duplicated in each new row created.

Examples

Split the list column [Name] in the table.

Table.ExpandListColumn( 
    Table.FromRecords( {[Name = {"Bob", "Jim", "Paul"}, Discount = .15]} ),
    "Name"
 )

 /* Output: 
Table.FromRecords( {
    [Name = "Bob", Discount = 0.15],
    [Name = "Jim", Discount = 0.15],
    [Name = "Paul", Discount = 0.15]
} )
 */ 

Other functions related to Table.ExpandListColumn are:

BI Gorilla Youtube Channel

Last update: August 28, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-expandlistcolumn
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.