OpenBI Docs Buy

Table.FromValue

Makes a table out of any value: a single value, a list, or a record's fields.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.FromValue(value as any, optional options as nullable record) as table
ParameterTypeDescription
valueanyThe value to turn into a table.
optionsnullable record
optional
A record of options: DefaultColumnName names the column the values go in.

Returns

table. A list gives one row per item and a record one row per field, with its Name and Value; any other value gives a single row. The values are in a column named Value, or as DefaultColumnName says.

Examples

A single number

Table.FromValue(540)
Value
540

A record's fields

Table.FromValue([Product = "Chair", Price = 50])
NameValue
ProductChair
Price50

A list, its column named

Table.FromValue({"Chair", "Desk"}, [DefaultColumnName = "Product"])
Product
Chair
Desk

Table.FromList, Table.FromRecords, Record.ToTable.

Last updated · OpenBI Studio 0.3.79