Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Latest commit

 

History

History
23 lines (20 loc) · 775 Bytes

Table.Min.md

File metadata and controls

23 lines (20 loc) · 775 Bytes

Table.Min

Returns the smallest row or a default value using the given criteria.

function (table as table, optional comparisonCriteria as nullable any, optional default as nullable any) as nullable any

Description

Returns the smallest row in the table, given the comparisonCriteria. If the table is empty, the optional default value is returned.

Category

Table.Ordering

Examples

Find the row with the smallest value in column [a] in the table.

Table.Min(Table.FromRecords({[a = 2, b = 4], [a = 6, b = 8]}), "a")

[a = 2, b = 4]


Find the row with the smallest value in column [a] in the table. Return -1 if empty.

Table.Min(#table({"a"},{}), "a", -1)

-1