Date.AddMonths

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

Returns the date, datetime, or datetimezone result from adding numberOfMonths months to the datetime value dateTime.

  • dateTime: The date, datetime, or datetimezone value to which months are being added.
  • numberOfMonths: The number of months to add.

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 Youtube Channel

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-addmonths
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.