Greatest

Returns the greatest value from two or more values with matching data types.

Syntax

Greatest(input1, [input2], ...)

input 1 (required) The data or column of data to be evaluated. Input can be numbers, dates, or strings.

input 2+ (optional) Additional inputs to compare. All additional inputs must match the type of the first input.

Notes

  • To compare two values of different data types, convert one of the values to match the data type of the other using the appropriate type conversion function. For example, you can convert a string to a number using the Number function, or to a date using the Date function.

Example

Greatest(1, 2)
  • Returns 2.
Greatest([Date], Date("2025-12-20"))
  • In a calculated column, converts the text "2025-12-20" to a date, then compares it to the date in the Date column and returns the later of the two.
A table with three columns, Order Number, Date, and Greatest. The Greatest column shows the later of the two dates between "2025-12-20" and the date in the Date column for each row
Greatest([Profit 2022], [Profit 2023], [Profit 2024])
  • In a table summary, returns the profit for the year with the highest profit.
A table with four table summaries, one for each of the years 2022, 2023, and 2024, and one for the most profitable year. The most profitable year is 2024