Table.Max
Syntaxis
Table.Max(table as table, comparisonCriteria as any, optional default as any) as any
Over
Retourneert de grootste rij in de table
, gegeven de comparisonCriteria
. Als de tabel leeg is, wordt de optionele default
waarde geretourneerd.
Voorbeeld 1
Zoek de rij met de grootste waarde in kolom [a] in de tabel ({[a = 2, b = 4], [a = 6, b = 8]})
.
Gebruik
Table.Max(
Table.FromRecords({
[a = 2, b = 4],
[a = 6, b = 8]
}),
"a"
)
Uitvoer
[a = 6, b = 8]
Voorbeeld 2
Zoek de rij met de grootste waarde in kolom [a] in de tabel ({})
. Retourneer -1 als deze leeg is.
Gebruik
Table.Max(#table({"a"}, {}), "a", -1)
Uitvoer
-1