Date.AddMonths

Updated on

Date.AddMonths is a function in the Power Query M language that adds a specified number of months to a date or datetime value. The resulting value is returned as a date, datetime, or datetimezone.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Date.AddMonths(
   dateTime as any,
   numberOfMonths as number,
) as any

Description

Date.AddMonths adds a specified number of months (numberOfMonths) to a date, datetime, or datetimezone value (dateTime). It returns the resulting date after the addition.

Examples

Add 5 months to the date, datetime, or datetimezone value representing the date 5/14/2011.

// Output: #date( 2011, 10, 14 )
Date.AddMonths( #date( 2011, 5, 14 ), 5 )

Add 18 months to the date, datetime, or datetimezone value representing the date and time of 5/14/2011 08:15:22 AM.

// Output: #datetime( 2012, 11, 14, 8, 15, 22 )
Date.AddMonths( #datetime( 2011, 5, 14, 8, 15, 22 ), 18 )

Learn more about Date.AddMonths in the following articles:

Other functions related to Date.AddMonths are:

BI Gorilla Blog

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-addmonths