Returns the maximum value or the default value for an empty list.
function (
list
as list, optionaldefault
as nullable any, optionalcomparisonCriteria
as nullable any, optionalincludeNulls
as nullable any) as nullable any
Returns the maximum item in the list list
, or the optional default value default
if the list is empty. An optional comparisonCriteria value, comparisonCriteria
, may be specified to determine how to compare the items in the list. If this parameter is null, the default comparer is used.
List.Ordering
Find the max in the list {1, 4, 7, 3, -2, 5}.
List.Max({1, 4, 7, 3, -2, 5},1)
7
Find the max in the list {} or return -1 if it is empty.
List.Max({}, -1)
-1