# MAX

The *MAX* function returns the largest number from a set of values. It evaluates the provided numbers or node references and identifies the highest value among them. This function is commonly used in data analysis to determine maximum values, peaks, or top-performing results within a dataset.

#### Syntax

```javascript
MAX(value1, [value2], ...)
```

#### Arguments

* `value1`: The first number, array, or reference that contains numbers.
* `value2, ...` (Optional): Additional numbers, arrays, or references that contain numbers.

#### Return value

Returns the largest value from the specified arguments.

#### Example

```javascript
MAX(Q1.Units, Q2.Units, Q3.Units, Q4.Units)
```

In the example below, the *Max Unit* measure is created using the MAX function, which returns the largest unit value across the four quarters.

<figure><img src="/files/1bCEw1k4h0NsMadzNerQ" alt=""><figcaption></figcaption></figure>

#### Excel Equivalent

[MAX](https://support.microsoft.com/en-us/office/max-function-e0012414-9ac8-4b34-9a47-73e662c08098)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/formula-syntax/math-functions/max.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
