> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Max

> Use the Sigma Max function to find the maximum value for a column or group.

The **Max** function finds the maximum value for a column or group.

The **Max** function is an aggregate function.

Aggregate functions evaluate one or more rows of data and return a single value.

In a table element, the aggregate is calculated for each grouping. For information on how to add a grouping with an aggregate calculation to a table, see [Group columns in a table](/docs/create-and-manage-tables#group-columns-in-a-table).

In a table with no groupings, the aggregate is calculated for each row. For information on how to calculate summary statistics across all rows in a table, see [Add summary statistics to a table](/docs/create-and-manage-tables#add-summary-statistics-to-a-table).

To learn more about using aggregate functions, see [Building complex formulas with grouped data](https://www.sigmacomputing.com/resources/training-videos/table-grouping-and-functions#complex-formulas).

## Syntax

```
Max(field)
```

Function arguments:

* **field** (required) - The column to be searched.

## Notes

* The **field** argument must be a value with the **Number**, **Date**, or **Text** [data type](/docs/data-types-and-formats).

## Examples

```
Max([Distance])
```

* In a table summary, returns the greatest *Distance* across all rows in the table.
* In a calculated column in an ungrouped table, returns each row's own *Distance* value.
* In a table grouped by *Airline*, returns the greatest *Distance* for each airline.

```
Max([Invoice Date])
```

When used in a table summary, returns the greatest invoice date, which is the most recent date in the `[Invoice Date]` column.

```
Max([Name])
```

When used in a table summary, returns the name that is alphabetically last from the `[Name]` column.

```
GrandTotal(Max([Cost]))
```

When used in a calculated column in a table, returns the greatest cost from the `[Cost]` column in each row.

## Related resources

* [CumulativeMax](/docs/cumulativemax)
* [Min](/docs/min)
* [MovingMax](/docs/movingmax)
* [Greatest](/docs/greatest)