Table.FromList turns a list into a table, with one row per list item and as many columns as you ask for. Available in Excel (Power Query), Power BI Desktop, and Power BI Service.
If you have a list of values, or a list of records, and you want it as a proper table you can work with, this is the function that does it.
Syntax of Table.FromList Function
Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable number) as table
where
list(required, list). The list you want to turn into a table. Each item becomes one row.splitter(optional, nullable function). A splitter function that decides how each item is broken into column values. Omit it andTable.FromListsplits each text item on commas.columns(optional, any). The column names, as a list of text values, or a number of columns. Omit it and you get a single column namedColumn1.default(optional, any). The value used to fill in missing columns when an item produces fewer values than there are columns.extraValues(optional, nullable number). AnExtraValuesoption that controls what happens when an item produces more values than there are columns:ExtraValues.List,ExtraValues.Ignore, orExtraValues.Error(the default).
Returns: a table built from the list, with one row per item. With no splitter or columns, you get a single Column1 holding the list values as-is.
In plain terms, you hand it a list and tell it how to slice each item into columns, and it gives you back a table.
Example 1: Turn a simple list into a one-column table
You have a list of drink names and want them as a table.
let
Source = Table.FromList({"Latte","Mocha","Espresso"})
in
Source
With no other arguments, each item becomes a row in a single column.
The result is one column named Column1:
| Column1 |
|---|
| Latte |
| Mocha |
| Espresso |
This is the most common use. You take a bare list and get back a table you can transform.
Example 2: Split each item into named columns
Each list item is a comma-separated pair, and you want two named columns out of it.
The starting list looks like this:
| List item |
|---|
| Latte,Hot |
| Cold Brew,Cold |
| Mocha,Hot |
Pass a list of column names. With no splitter, the default splits each item on its commas.
let
Source = Table.FromList({"Latte,Hot","Cold Brew,Cold","Mocha,Hot"},null,{"Drink","Temperature"})
in
Source
Each item is split at the comma, and the two pieces land in Drink and Temperature.
The result is a two-column table:
| Drink | Temperature |
|---|---|
| Latte | Hot |
| Cold Brew | Cold |
| Mocha | Hot |
Naming two columns tells Table.FromList to expect two values from every item.
Example 3: Keep commas inside the values
Your items contain commas you want to keep, like a cafe name and city in one string.
The starting list looks like this:
| List item |
|---|
| Quartz Cafe, Berlin |
| Nimbus Roasters, Lyon |
| Harbor Beans, Porto |
The default splitter would break each item at its comma. Use Splitter.SplitByNothing() to keep each item whole.
let
Source = Table.FromList({"Quartz Cafe, Berlin","Nimbus Roasters, Lyon","Harbor Beans, Porto"},Splitter.SplitByNothing(),{"Location"})
in
Source
Splitter.SplitByNothing() is a built-in Power Query splitter that does no splitting, so the comma stays inside each value.
The result keeps each item intact in one column:
| Location |
|---|
| Quartz Cafe, Berlin |
| Nimbus Roasters, Lyon |
| Harbor Beans, Porto |
This is the fix whenever the default comma split mangles values that legitimately contain commas.
Example 4: Build a table from a list of records
Your list holds records, and you want each field in its own column.
The starting list holds these records:
| List item |
|---|
| [StaffID=51, Name=”Priya”] |
| [StaffID=52, Name=”Marco”] |
| [StaffID=53, Name=”Lena”] |
Pass Record.FieldValues as the splitter so each record’s values become the row’s columns.
let
Source = Table.FromList({[StaffID=51,Name="Priya"],[StaffID=52,Name="Marco"],[StaffID=53,Name="Lena"]},Record.FieldValues,{"StaffID","Name"})
in
Source
Record.FieldValues pulls each record’s values into the row, in field order.
The result is a clean two-column table:
| StaffID | Name |
|---|---|
| 51 | Priya |
| 52 | Marco |
| 53 | Lena |
The numbers stay numbers because the record values keep their original types.
Example 5: Ignore extra values when items are uneven
Some items split into more pieces than you have columns, and you want the extras dropped rather than an error.
The starting list is uneven:
| List item |
|---|
| Pen,Blue,Surplus |
| Notebook,Red |
By default, an item with too many values throws an error. Pass ExtraValues.Ignore to drop the surplus.
let
Source = Table.FromList({"Pen,Blue,Surplus","Notebook,Red"},Splitter.SplitTextByDelimiter(","),{"Item","Color"},null,ExtraValues.Ignore)
in
Source
The first item has three values but only two columns, so Surplus is dropped.
The result fits both rows into two columns:
| Item | Color |
|---|---|
| Pen | Blue |
| Notebook | Red |
Without ExtraValues.Ignore here, the Pen row would throw an error instead of loading.
Things to keep in mind with Table.FromList
- Too many values throws an error by default.
Expression.Error: There were too many elements in the enumeration to complete the operation.PassExtraValues.Ignoreto drop the surplus, orExtraValues.Listto collect them into a list column. - Too few values uses
default. When an item produces fewer values than there are columns, the missing cells get thedefaultvalue (nullif you don’t set one). columnscan be a plain number, not just names. Pass2instead of{"Drink","Temperature"}and you get that many columns with auto names likeColumn1andColumn2, handy when you don’t care what they’re called yet.
Performance and query folding
Table.FromList runs in memory and does not fold, since the list is already loaded into Power Query before it runs. It is fast for the list sizes you normally build by hand. For wide, splitter-heavy work on large lists, splitting in a dedicated step is often easier to read than packing everything into one Table.FromList call.
Common questions about Table.FromList
What is the difference between Table.FromList and Table.FromRecords?
Table.FromList works on any list and lets you control splitting, while Table.FromRecords takes a list of records and reads the column names straight from the fields, no splitter needed.
Can I get the column names automatically from records?
Not with Table.FromList. It needs you to pass the column names. If you want the fields to become columns on their own, use Table.FromRecords instead.
List of All Power Query Functions
Related Power Query Functions / Articles:
- Table.ExpandRecordColumn Function
- Table.SelectColumns Function
- Json.Document Function
- Table.FromRecords Function
- Text.Split Function
- Table.ExpandTableColumn Function
- Table.ToList Function
- Table.UnpivotOtherColumns Function
- Table.Pivot Function
- Table.SplitColumn Function
- Table.ColumnNames Function
- Table.FromColumns Function