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
Date.AddMonths( dateTime as any, numberOfMonths as number, ) as any
datetimezone result from adding
numberOfMonths months to the
datetimezonevalue to which months are being added.
numberOfMonths: The number of months to add.
Add 5 months to the
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
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:
- Date Table with Monthly Increments in Power Query
Are you looking to create a date table with Monthly increments in Power Query? With Power Query, creating a monthly calendar is a breeze. » Read more
Other functions related to Date.AddMonths are: