Table.MinN
Returns the smallest row(s) using the given criteria.
function (table
as table, optionalcomparisonCriteria
as nullable any, optionalcountOrCondition
as nullable any) as table
Returns the smallest row(s) in the
table
, given the comparisonCriteria
. After the rows are sorted, the countOrCondition
parameter must be specified to further filter the result. Note the sorting algorithm cannot guarantee a fixed sorted result. The countOrCondition
parameter can take multiple forms: Table.Ordering
Find the row with the smallest value in column [a] with the condition [a] < 3, in the table. The rows are sorted before the filter is applied.
Table.MinN(Table.FromRecords({[a = 2, b = 4], [a = 0, b = 0], [a = 6, b = 4]}), "a", each [a] < 3)
Table.FromRecords({[a = 0, b = 0], [a = 2, b = 4]})
Find the row with the smallest value in column [a] with the condition [b] < 0, in the table. The rows are sorted before the filter is applied.
Table.MinN(Table.FromRecords({[a = 2, b = 4], [a = 8, b = 0], [a = 6, b = 2]}), "a", each [b] < 0)
Table.FromRecords({})
Last modified 4yr ago