max() (aggregation function)

Learn how to use the max() function to find the maximum value of the expression in the table.

Finds the maximum value of the expression in the table.

Syntax

max(expr)

Parameters

NameTypeRequiredDescription
exprstring✔️The expression for which the maximum value is determined.

Returns

Returns the value in the table that maximizes the specified expression.

Example

The following example returns the last record in a table by querying the maximum value for StartTime.

StormEvents
| summarize LatestEvent=max(StartTime)

Output

LatestEvent
2007-12-31T23:53:00Z