The GENERATESERIES function returns a table with a single column containing the values of an arithmetic progression.
GENERATESERIES(
start_value,
end_value
[, increment_value]
)
- 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.
The GENERATESERIES function returns a table.
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.
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)
If end_value is less than start_value, the function returns an empty table:
Progresión aritmética = GENERATESERIES(12, 8, 2)
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)