Date functions

Date functions functions for Power Query M language.

Functions

FunctionDescription
#dateGenerates a date value by utilizing integer values to represent the year, month, and day. It will trigger an error if the following conditions are not met: The year must be between 1 and 9999, the mon...
Date.AddDaysThis function calculates and returns the date, time, or timezone after adding a specified number of days to a given date and time value. The input parameters include the initial date and time value, a...
Date.AddMonthsThis function calculates the date, time, or timezone result obtained by adding a specified number of months to a given datetime value. It takes two parameters as input: dateTime, which is the original...
Date.AddQuartersThis function will generate a new date, datetime, or datetimezone by adding a specified number of quarters to the input datetime value. The input parameters include the original datetime value (dateTi...
Date.AddWeeksThis function calculates the new date, datetime, or datetimezone value that is obtained by adding a specified number of weeks to a given date, datetime, or datetimezone value. The parameter "dateTime"...
Date.AddYearsThis function retrieves the date, datetime, or datetimezone obtained by adding the specified number of years to a given datetime value. dateTime: The original date, datetime, or datetimezone to which...
Date.DayThis function retrieves the day component from a given date, datetime, or datetimezone value. The parameter "dateTime" specifies the input date, datetime, or datetimezone value from which the day comp...
Date.DayOfWeekThis function calculates and returns a number (ranging from 0 to 6) that represents the day of the week for the specified date and time. The input parameters include dateTime (which can be a date, dat...
Date.DayOfWeekNameThis function retrieves the name of the day of the week based on the input date. It also allows for an optional parameter, such as a specific culture (e.g. "en-US"), to be specified.
Date.DayOfYearThis function will return a numerical value that indicates the specific day of the year based on the inputted date, datetime, or datetimezone value within the dateTime parameter.
Date.DaysInMonthThis function determines the amount of days in the month for the specified date, datetime, or datetimezone value dateTime.dateTime. The input should be a date, datetime, or datetimezone value.
Date.EndOfDayThis function retrieves the end of the day based on the input dateTime while preserving time zone information. The input should be a date, datetime, or datetimezone value from which the end of the day...
Date.EndOfMonthThis function retrieves the last day of the month that includes the specified dateTime.dateTime. The input can be a date, datetime, or datetimezone value that is used to determine the end of the month...
Date.EndOfQuarterThe function retrieves the last day of the quarter that includes the dateTime provided. The time zone data is maintained. The input parameter, dateTime, should be a date, datetime, or datetimezone val...
Date.EndOfWeekThis function returns the end of the week that includes the specified dateTime input. Optionally, you can specify a Day value, firstDayOfWeek, to determine which day is considered the first day of the...
Date.EndOfYearThis function retrieves the end of the year that corresponds to the provided dateTime, including fractional seconds. The time zone information associated with the dateTime is maintained. The input sho...
Date.FromThe function returns a date value based on the input provided. You can also specify an optional culture (for example, "en-US"). If the input value is null, the function returns null. If the input valu...
Date.FromTextThis function converts a text representation into a date value. It can also accept an optional record parameter called options, which can specify additional properties. The record can include the foll...
Date.IsInCurrentDayThis function determines if the provided dateTime value falls within the current day based on the system's current date and time. The dateTime parameter should be a date, datetime, or datetimezone val...
Date.IsInCurrentMonthThis function checks if the specified datetime value dateTime falls within the current month based on the current date and time of the system. The parameter dateTime refers to a date, datetime, or dat...
Date.IsInCurrentQuarterThis function determines if the provided datetime value (dateTime) falls within the current quarter based on the current date and time of the system. The input parameter, dateTime, can be a date, date...
Date.IsInCurrentWeekThis function checks if the provided date and time value, dateTime, falls within the current week based on the system's current date and time. The dateTime parameter can be a date, datetime, or dateti...
Date.IsInCurrentYearThis function checks if the specified datetime value dateTime falls within the current year, based on the system's current date and time. The input parameter dateTime can be a date, datetime, or datet...
Date.IsInNextDayThis function checks if the provided date and time value, dateTime, falls on the next day based on the current date and time of the system. It is important to note that this function will return false...
Date.IsInNextMonthThis function determines if the specified date and time value occurs in the upcoming month based on the current date and time of the system. It should be noted that the function will return a false va...
Date.IsInNextNDaysThis function determines if a specified date and time value, dateTime, falls within the next specified number of days based on the current date and time of the system. It is important to note that thi...
Date.IsInNextNMonthsThis function determines if the provided dateTime value occurs within the next specified number of months, based on the current date and time of the system. It should be noted that the function will r...
Date.IsInNextNQuartersThis function checks if the provided date and time value (dateTime) falls within the specified number of upcoming quarters based on the current system date and time. It is important to note that the f...
Date.IsInNextNWeeksThis function checks if the provided datetime value dateTime falls within the next set number of weeks, based on the current date and time of the system. Keep in mind that if a value falls within the ...
Date.IsInNextNYearsThis function determines if a specific datetime value, dateTime, falls within the next number of years from the current date and time on the system. It is important to note that the function will retu...
Date.IsInNextQuarterThis function determines if the provided datetime value occurs in the next quarter based on the current date and time of the system. It should be noted that if a value falls within the current quarter...
Date.IsInNextWeekThis function determines if a specified date and time value, dateTime, falls within the upcoming week based on the current date and time set on the system. It should be noted that when a value falls w...
Date.IsInNextYearThis function determines if the provided datetime value (dateTime) falls within the upcoming year based on the current date and time of the system. It is important to note that this function will retu...
Date.IsInPreviousDayThis function determines if a specific date and time value, referred to as "dateTime", falls within the day prior to the current date and time on the system. It is important to note that this function...
Date.IsInPreviousMonthThis function checks if the provided datetime value, dateTime, happened in the month before the current date and time on the system. Keep in mind that when a value from the current month is passed to ...
Date.IsInPreviousNDaysThis function checks if the provided date and time value (dateTime) falls within the specified number of days prior to the current date and time on the system. It should be noted that this function wi...
Date.IsInPreviousNMonthsThis function checks if the specified datetime value dateTime falls within the previous number of months, based on the current date and time of the system. It will return false if the value is within ...
Date.IsInPreviousNQuartersThis function determines if the provided date and time value, dateTime, falls within the previous number of quarters based on the current date and time on the system. It should be noted that the funct...
Date.IsInPreviousNWeeksThis function assesses if the specified datetime value, dateTime, falls within the previous number of weeks based on the current date and time of the system. It should be noted that the function will ...
Date.IsInPreviousNYearsThis function checks if the provided date and time value (dateTime) falls within the number of years specified in the current system date and time. It should be noted that the function will return fal...
Date.IsInPreviousQuarterThis function checks if the specified dateTime falls within the previous quarter based on the current date and time of the system. It should be noted that the function will return false if the input v...
Date.IsInPreviousWeekThis function determines if the provided datetime value, dateTime, falls within the previous week based on the current date and time of the system. It is important to note that when a value within the...
Date.IsInPreviousYearThis function evaluates if the provided datetime value, dateTime, falls within the previous year based on the current date and time on the system. It is important to note that the function will return...
Date.IsInYearToDateThis function determines if the provided dateTime value falls within the current year and is on or before the current day, based on the system's current date and time. The dateTime parameter can be ei...
Date.IsLeapYearThis function determines if a specified datetime value, dateTime, corresponds to a leap year. The input should be a date, datetime, or datetimezone value for evaluation.
Date.MonthThis function will retrieve the month component from the specified datetime value, dateTime.
Date.MonthNameThis function retrieves the month name for the given date parameter. Users can also specify an optional culture code, such as "en-US", to further customize the output.
Date.QuarterOfYearThis function determines the quarter of the year in which a specified date falls. The function returns a number between 1 and 4, representing the quarter. The input parameter, 'dateTime,' can accept v...
Date.StartOfDayThis function retrieves the beginning of the day associated with the dateTime input. The dateTime parameter should be a date, datetime, or datetimezone data type.
Date.StartOfMonthThis function retrieves the beginning of the month in which the specified dateTime falls. The input dateTime should be either a date or datetime type value.
Date.StartOfQuarterThis function retrieves the beginning of the quarter where the specified dateTime falls. The dateTime parameter can be a date, datetime, or datetimezone value.
Date.StartOfWeekThis function returns the beginning of the week that includes the specified dateTime. The input dateTime can be a date, datetime, or datetimezone value.
Date.StartOfYearThis function will return the beginning of the year in which the specified date and time falls. The input must be a valid date, date and time, or date, time, and time zone value.
Date.ToRecordThe function retrieves a record that includes the components of the specified date value, date.date: This is the date value used to calculate the individual parts of the record.
Date.ToTextThis function returns a text representation of a date. You can use an additional parameter called options to specify more properties if needed. The culture parameter is only used in older workflows. T...
Date.WeekOfMonthThis function returns a numerical value between 1 and 6, indicating the specific week within the month that corresponds to the given datetime value. The input parameter "dateTime" is a specific dateti...
Date.WeekOfYearThe function will output a number between 1 and 54 to represent the week of the year for a given date and time value. The date and time value provided will be used to determine the week of the year. A...
Date.YearThe function retrieves the year portion of the datetime value, dateTime.