Table.ToList is a Power Query M function that converts a table into a list by applying the specified combining function to each row of values in the table. The function returns a list containing the combined values from each row.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Table.ToList(
table as table,
optional combiner as nullable function,
) as list
Argument | Attribute | Description |
---|---|---|
table | The table to turn into a list. | |
combiner | optional | Combiner Functions specify how rows should be combined. The argument can merge rows using different methods: – Combiner.CombineTextByDelimiter: using the specified delimiter. – Combiner.CombineTextByEachDelimiter: with each delimiter in a sequence. – Combiner.CombineTextByLengths: based on specified lengths. – Combiner.CombineTextByPositions: according to specified positions. – Combiner.CombineTextByRanges: using positions and lengths. |
Description
Table.ToList converts the table into a list, applying a combining function to each row’s values within the table.
Examples
Combine the text of each row with a comma.
// Output: {"1,Bob,123-4567", "2,Jim,987-6543", "3,Paul,543-7890"}
Table.ToList(
Table.FromRows( {
{Number.ToText( 1 ), "Bob", "123-4567"},
{Number.ToText( 2 ), "Jim", "987-6543"},
{Number.ToText( 3 ), "Paul", "543-7890"}
} ),
Combiner.CombineTextByDelimiter( "," )
)
Related functions
Other functions related to Table.ToList are: