Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.MinN

Owen Duncan|Last Updated: 4/19/2018

About

Returns the smallest N rows in the given table. After the rows are sorted, the countOrCondition parameter must be specified to further filter the result.

Table.MinN(table as table, comparisonCriteria as any, countOrCondition as any) as table  

Arguments

ArgumentDescription
tableThe Table to check.
comparisonCriteriaSmallest N rows comparison criteria.
countOrConditionAfter the rows are sorted, countOrCondition further filters the result.

The countOrCondition argument has two possible settings:

SettingDescription
as a numberA list of items up to countOrCondition items in ascending order is returned.
as a conditionA list of items that initially meet the condition is returned. Once an item fails the condition, no further items are considered.

Examples

Table.MinN(Employees, "Salary", 3) equals  
NameLevelSalary
Margo345000
Nikki575000
Andrew685000
Table.MinN(Employees, "Salary", each [Level] < 6) equals  
NameLevelSalary
Margo345000
Nikki575000
© 2018 Microsoft