OpenBI Docs Buy

DATATABLE

A table written out in the formula: its columns' names and types, then its rows.

Group: Table manipulation. Compatible with DAX.

Syntax

DATATABLE ( <ColumnName1>, <DataType1> [, <ColumnName>, <DataType>] …,
    { { <value>, … } [, { <value>, … }] … } )
ParameterTypeDescription
ColumnName1TextThe first column's name, in quotes.
DataType1KeywordIts type: INTEGER, DOUBLE, CURRENCY, STRING, BOOLEAN or DATETIME.
ColumnNameText
optional, repeatable
The name of each further column.
DataTypeKeyword
optional, repeatable
The type of that column.
dataRowsThe rows in braces, each row a list of values in braces, one value per column in the order the columns were named.

Returns

Table. A table with the columns and rows written out.

Remarks

  • Each value is a constant, such as 12, 3.5, "Pils", TRUE or FALSE, or BLANK () for an empty cell. DAX refuses formulas here.
  • Values take the column's type: 2.7 in an INTEGER column becomes 3, a CURRENCY value keeps four decimals, a number in a STRING column becomes text.
  • Write dates as text, "2026-01-31" or "2026-01-31 14:30:00". The form with a T between date and time is refused, and so is a date that does not exist.
  • Every row needs as many values as there are columns.
  • Texts that differ only in upper and lower case are one value, as in a column of the model: the first spelling is used for all of them.

Examples

Five types in one table

EVALUATE
DATATABLE (
    "Product", STRING, "Liters", INTEGER, "Price", DOUBLE, "Launched", DATETIME, "Organic", BOOLEAN,
    {
        { "Pils", 120, 38.5, "2024-03-01", FALSE },
        { "IPA", 80, 64, "2025-06-15", TRUE },
        { "Cider", BLANK (), 52, BLANK (), FALSE }
    }
)
ORDER BY [Product]
ProductLitersPriceLaunchedOrganic
Cider(blank)52(blank)FALSE
IPA80642025-06-15TRUE
Pils12038.52024-03-01FALSE

Values take the column's type

EVALUATE
DATATABLE (
    "Whole", INTEGER, "Money", CURRENCY, "Text", STRING, "Flag", BOOLEAN,
    { { 2.7, 12.34567, 2, 1 } }
)
WholeMoneyTextFlag
312.34572TRUE

One spelling per text

Three spellings of one name: the first one stands for all three.

EVALUATE
DATATABLE ( "Product", STRING, { { "Pils" }, { "PILS" }, { "pils" } } )
ORDER BY [Product]
Product
Pils
Pils
Pils

ROW, SELECTCOLUMNS, UNION, GENERATESERIES.

Last updated · OpenBI Studio 0.3.74