DATESINPERIOD DAX Function (Time Intelligence)

Returns the dates from the given period.

Syntax

DATESINPERIOD ( <Dates>, <StartDate>, <NumberOfIntervals>, <Interval> )
Parameter Attributes Description
Dates

A column reference containing dates.

StartDate

Start date.

NumberOfIntervals

The number of intervals.

Interval

One of: Day, Month, Quarter, Year.

Return values

Table A table with a single column.

A table containing a single column of date values.

Remarks

The dates argument must be a reference to a date/time column.
The result table includes only dates that exist in the dates column.

Examples

The following expression evaluates the measure Sales Amount in the last 12 months starting from the last day of the period in the filter context.

Sales Moving Annual Total =
CALCULATE (
    [Sales Amount],
    DATESINPERIOD (
        'Date'[Date],
        MAX ( 'Date'[Date] ),
        -1,
        YEAR
    )
)

Last update: Dec 14, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Jes Hansen

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/datesinperiod-function-dax

DAX Conventions
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.

Iterator

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.

Deprecated

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

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

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