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>, … }] … } )
| Parameter | Type | Description |
|---|---|---|
ColumnName1 | Text | The first column's name, in quotes. |
DataType1 | Keyword | Its type: INTEGER, DOUBLE, CURRENCY, STRING, BOOLEAN or DATETIME. |
ColumnName | Text optional, repeatable | The name of each further column. |
DataType | Keyword optional, repeatable | The type of that column. |
data | Rows | The 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]
| Product | Liters | Price | Launched | Organic |
|---|---|---|---|---|
| Cider | (blank) | 52 | (blank) | FALSE |
| IPA | 80 | 64 | 2025-06-15 | TRUE |
| Pils | 120 | 38.5 | 2024-03-01 | FALSE |
Values take the column's type
EVALUATE
DATATABLE (
"Whole", INTEGER, "Money", CURRENCY, "Text", STRING, "Flag", BOOLEAN,
{ { 2.7, 12.34567, 2, 1 } }
)
| Whole | Money | Text | Flag |
|---|---|---|---|
| 3 | 12.3457 | 2 | TRUE |
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 |