Table.FromValue

Table

Wraps a scalar value, list, or record into a table.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.FromValue(value as any, optional options as nullable record) as table

Parameters

NameTypeRequiredDescription
valueanyYesThe value to wrap. May be a scalar, list, or record.
optionsrecordNoOptional record. Supports field DefaultColumnName (text) to override the default column name "Value".

Return Value

tableA single-column table (or multi-column for records) containing the provided value.

Remarks

Table.FromValue is a general-purpose wrapper that converts almost any M value into a table. The output structure depends on the input type:

- Scalar (number, text, date, logical, etc.): produces a single-row, single-column table named Value. - List: produces a single-column table with one row per list element, column named Value. - Record: produces a two-column table (Name and Value) with one row per field. - Table: returns the table unchanged.

Use the options record's DefaultColumnName field to rename the default Value column to something more descriptive. Table.FromValue is useful in dynamic scenarios where the input type is unknown at authoring time — it provides a uniform table interface regardless of what value is passed in.

For converting a list to a single-column table with a known name, Table.FromList or Table.FromValue({...}, [DefaultColumnName = "MyCol"]) are both valid. For records, Table.FromValue generates a vertical key-value layout (useful for serialization or display), which differs from Table.FromRecords (which expects a list of records and produces a row per record).

Examples

Example 1: Wrap a scalar number into a table

Table.FromValue(42, [DefaultColumnName = "OrderCount"])
Result
OrderCount
142

Example 2: Convert a list of product prices into a table

let
    Prices = {25.00, 50.00, 15.00, 75.00, 120.00}
in
    Table.FromValue(Prices, [DefaultColumnName = "Price"])
Result
Price
125
250
315
475
5120

Example 3: Convert a record into a key-value table

let
    Config = [StartDate = "2024-01-01", EndDate = "2024-12-31", MaxRows = 1000]
in
    Table.FromValue(Config)
Result
Name
Value
1StartDate2024-01-01
2EndDate2024-12-31
3MaxRows1000

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks