GENERATESERIES

The GENERATESERIES function returns a table with a single column containing the values of an arithmetic progression.

Syntax

GENERATESERIES(
    start_value,
    end_value
    [, increment_value]
)

Parameters
  • start_value: Initial value of the sequence of values to generate.
  • end_value: Final value of the sequence of values to generate.
  • increment_value: Optional argument. Increment to be applied to generate the new values. If it is not specified, the value 1 is taken by default.
Returned value

The GENERATESERIES function returns a table.

Additional Information

If end_value is less than start_value, the function returns an empty table.

increment_value must be a positive number greater than zero. If it is not, the function returns an error message.

The sequence ends with the largest value that is equal to or less than end_value.

Examples

We can generate an arithmetic progression between the numbers 2 and 8 with an increment of 2 with the following DAX expression:

Progresión aritmética = GENERATESERIES(2, 8, 2)

GENERATESERIES function. Example of use

If end_value is less than start_value, the function returns an empty table:

Progresión aritmética = GENERATESERIES(12, 8, 2)

GENERATESERIES function. Example of use

The progression ends with the largest value that is equal to or less than end_value. In the following example, a progression between 0 and 10 is generated with an increment of 3. You can see how it ends in the value 9 because the next one, 12, exceeds end_value :

Progresión aritmética = GENERATESERIES(0, 10, 3)

GENERATESERIES function. Example of use
Category
Other functions
Submitted by admin on Wed, 01/16/2019 - 14:49