The DATATABLE function allows you to declare a table by specifying its values.
DATATABLE(
<column_name>,
<column_type>,...,
{
{value, value...}
}
)
- column_name: Name of the column to create. It can be a DAX expression.
- column_type: Type of the column to create: INTEGER, DOUBLE, STRING, BOOLEAN, CURRENCY or DATETIME.
- value: Values to enter in the table.
The DATATABLE function returns a table.
We can create a table containing information about the number of people per department with the following DAX expression:
Employees per deparment =
DATATABLE(
"Department"; STRING;
"Number"; INTEGER;
{
{"Marketing"; 24};
{"Sales"; 56};
{"Operations"; 32};
{"Finance"; 5};
{"Administration"; 4}
}
)