DAX Date & Time - EDATE function


Advertisements

Description

Returns the date that is the indicated number of months before or after the start date.

Syntax

EDATE (<start_date>, <month>) 

Parameters

Sr.No. Parameter & Description
1

start_date

A date that represents the start date.

It can be in datetime or text format.

2

months

An integer that represents the number of months before or after start_date.

If months is not an integer, it is truncated.

Return Value

A date in datetime format.

Remarks

You can use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.

DAX works with dates in datetime format. Dates stored in other formats are converted implicitly.

  • If start_date is not a valid date, EDATE returns an error value.

    Make sure that the column reference or date that you supply as the first parameter is a date.

  • DAX EDATE function uses the locale and date/time settings of the client computer to understand the text value in order to perform the conversion. For example,

    • If the current date/time settings represent dates in the format of Month/Day/Year, then the string, "1/8/2016" is understood as a datetime value equivalent to 8th January, 2016.

    • If the current date/time settings represent dates in the format of Day/Month/Year, the same string would be understood as a datetime value equivalent to 1st August, 2016.

Example

= EDATE (DATE (2015,1,1),9) returns 10/1/2015 12:00:00 AM 
= EDATE (DATE (2015,1,30),1) returns 2/28/2015 12:00:00 AM 
= EDATE (DATE (2015,1,29),1) returns 2/28/2015 12:00:00 AM 
dax_functions_date_time.htm

Useful Video Courses


Video

Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Abhay Gadiya

Video

Mastering DAX Studio

Featured

24 Lectures 2 hours

Randy Minder

Video

DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours

Randy Minder

Advertisements