GENERATESERIES DAX Function (Table manipulation)

Returns a table with one column, populated with sequential values from start to end.


GENERATESERIES ( <StartValue>, <EndValue> [, <IncrementValue>] )
Parameter Attributes Description

The start value of the column.


The end value of the column.

IncrementValue Optional

The increment value of the column.

Return values

Table A table with a single column.

A single column table containing the values of an arithmetic series.
The name of the column is Value.


When EndValue is less than StartValue, an empty table is returned.
IncrementValue must be a positive value.
The sequence stops at the last value that is less than or equal to EndValue.


This example uses GENERATE to create a table for time within a day with the minute granularity.

//Time Dimension 
//Working Hours 9:00am to 5:00pm 
VAR Opening = 9
VAR Closing = 17
//Time Slot 
VAR TimeSlot = 30
VAR Offset = ( TimeSlot / 2 )
        GENERATESERIES ( 0, 1439, 1 ),
        // 24 hours/day * 60 minutes/hour = 1,440 - 1 (initial time 12am) 
        VAR __Minutes = [Value]
        VAR __Time =
            TIME ( 0, __Minutes, 0 )
        // MROUND: Rounds Value to the nearest multiple of TimeSlot
        VAR __MinutesRounded =
            MROUND ( ( __Minutes + Offset ), TimeSlot )
        VAR __StartTimeSlotRounded =
            TIME ( 0, __MinutesRounded - TimeSlot, 0 )
        VAR __EndTimeSlotRounded =
            TIME ( 0, __MinutesRounded, 0 )
            ROW (
                    "Hour", HOUR ( __Time ),
                    "Minute", MINUTE ( __Time ),
                    "Hour Minute 24h", FORMAT ( __Time, "hh:mm" ),
                    "Hour Minute 12h", FORMAT ( __Time, "hh:mm AM/PM" ),
                    "30 Minute Slot Start", FORMAT ( __StartTimeSlotRounded, "hh:mm" ),
                    "30 Minute Slot End", FORMAT ( __EndTimeSlotRounded, "hh:mm" ),
                    "30 Minute Slot", FORMAT ( __StartTimeSlotRounded, "hh:mm" ) & "-"
                        & FORMAT ( __EndTimeSlotRounded, "hh:mm" ),
                    "Working Hours", IF (
                        ( __Minutes / 60 ) &gt;= Opening
                            && ( __Minutes / 60 ) &lt;= Closing,
                    "Time", __Time,
                    "TimeSlot Start", __StartTimeSlotRounded,
                    "TimeSlot End", __EndTimeSlotRounded

Related articles

Learn more about GENERATESERIES in the following articles:

Last update: Nov 20, 2020   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Daniil Maslyuk, Naji El Kotob

MSDN documentation:

Black Friday
2018-2020 © SQLBI. All rights are reserved. Information coming from MSDN is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.


Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.


This function is deprecated. Jump to the Alternatives section to see the function to use.


This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.


Want to improve the content of GENERATESERIES? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.