MAX

The MAX function returns the largest value of a column or of two scalar expressions considering numbers, dates and texts.

Syntax

MAX(
    column
)

MAX(
    expression1,
    expression2
)

Parameters
  • column: Name of the column from which you want to extract the highest value.
  • expression: Scalar expression to evaluate.
Returned value

The MAX function returns a scalar.

Additional Information

When two expressions are compared, Blanks are treated as 0. That is, MAX(1, BLANK()) is equivalent to MAX(1, 0) and returns 1, and MAX(-1, BLANK()) is equivalent to MAX(-1, 0) and returns 0.

This function does not support the Boolean values True and False. If you want to evaluate the largest value in a column that includes Booleans, you should use the MAXA function.

Examples

If the FactSales[UnitPrice] column contains the prices of the products for sale, we can calculate the product with the highest price with the following measure:

Precio máximo = MAX(FactSales[UnitPrice])

...returning the following value, shown in a card display:

MAX function: Example of use

Similarly, if the FactSales[DateKey] column contains dates, we can extract the most recent with the following measure:

Última fecha = MAX(FactSales[DateKey])

...returning the following value, again shown in a card display:

MAX function: Example of use

If the column Geography[Country] contains country names, we can obtain the country with the highest name (considering the unicode values of the characters that form it) with the following measure:

country = MAX(Geography[Country])

If we take this measure to a card, we obtain the following result:

MAX
Related functions
Category
Statistical
Submitted by admin on Tue, 12/04/2018 - 12:16