The MAX function returns the largest value of a column or of two scalar expressions considering numbers, dates and texts.
MAX(
column
)
MAX(
expression1,
expression2
)
- column: Name of the column from which you want to extract the highest value.
- expression: Scalar expression to evaluate.
The MAX function returns a scalar.
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.
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:
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: