DATATABLE

The DATATABLE function allows you to declare a table by specifying its values.

Syntax

DATATABLE(
    <column_name>,
    <column_type>,...,
    {
        {value, value...}
    }
)

Parameters
  • 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.
Returned value

The DATATABLE function returns a table.

Examples

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}
        }
    )

DATATABLE function. Example of use
Category
Other functions
Submitted by admin on Tue, 01/15/2019 - 21:22