Table.MinN

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

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  

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.
Table.MinN(Employees, "Salary", 3) equals  

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

NameLevelSalary
Margo345000
Nikki575000
Show: