Downloads
Power Query MTable: build and convertIntermediate

Table.FromColumns

Builds a table from a list of columns, where each column is a list of values.

Syntax
Table.FromColumns(lists as list, optional columns as any, optional missingField as nullable number) as table

Returns: A new table with one column for each list.

What it does

Table.FromColumns builds a table one column at a time. You give it one list for each column. It suits data that arrives as separate lists, such as a list of months and a list of budget figures that were built in separate steps.

Syntax and arguments

Example

A budget schedule is assembled from two lists: the month names, and the budget amounts for each month, which were calculated in another step.

let
    Months = {"Jan", "Feb", "Mar"},
    Budget = {10000, 12000, 9000},
    Schedule = Table.FromColumns({Months, Budget}, {"Month", "Budget"})
in
    Schedule

The first list becomes the Month column and the second becomes the Budget column. The lists must be the same length, so that each row is complete.

Things to watch

In business terms

A schedule built from separate lists, such as depreciation by year or a set of planned payments, can be assembled this way and then checked in the query. The lists themselves can be traced back to their calculations.

Related functions

All Power Query M functions · View as Markdown · M basics