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.

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.

Screen_Shot_2020-07-30_at_12.09.47_PM.png

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.

Screen_Shot_2020-07-30_at_12.14.42_PM.png