Skip to navigation

LastDay

View as Markdown

The LastDay function evaluates a specified date component (i.e., year, quarter, month, or week) in a date value and returns the last date and time in that component as a timestamp.

This function isn’t compatible with all data platform connections. To check if your connection supports it, see Supported data platforms and feature compatibility.

Syntax

LastDay(date, precision)

Function arguments:

  • date (required) - the date or column containing date values from which the date component is extracted
  • precision (required) - the date component (i.e., year, quarter, month, or week) evaluated for its last date and time

Examples

LastDay([Invoice Date], "month")

Extracts the month component from the date in the Invoice Date column and returns the last date and time for that month.

Table with Invoice Date, LastDay Month, and LastDay Year columns, where each date returns the last moment of its month, such as 2017-04-30 23:59:59, and of its year, such as 2017-12-31 23:59:59.

LastDay(Date("2020-01-10 10:34:29"), "year")

Extracts the year component from the specified date (January 10, 2020) and returns the last date and time for that year.

Table with a New Column showing 2020-12-31 23:59:59 in every row, the last moment of 2020, next to a Formatted to Year column showing 2020.