List.MinN

List

Returns the N smallest values from a list, or values meeting a condition, in ascending order.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

List.MinN(list as list, countOrCondition as any, optional comparisonCriteria as any) as list

Parameters

NameTypeRequiredDescription
listlistYesThe list to search.
countOrConditionanyYesA number specifying how many minimum values to return, or a condition function.
comparisonCriteriaanyNoAn optional comparison criteria or comparer function to control ordering.

Return Value

listA list of the N smallest values, sorted in ascending order.

Remarks

List.MinN returns the bottom N values from a list as a list sorted in ascending order. It is the multi-value counterpart of List.Min, which returns a single scalar.

When passed a number N, it returns the N smallest values from the list. If N exceeds the list length, the entire list is returned sorted ascending. Null values are ignored. Duplicates are preserved — if the Nth-smallest value appears multiple times, all occurrences are included.

When passed a condition function, the list is first sorted ascending and the condition is applied to each item in that order; items are collected while the condition returns true. This is useful for "give me all values below a threshold" scenarios.

For the single lowest value, use List.Min. To get the highest values instead, use List.MaxN. To sort and slice a full list, combining List.Sort and List.FirstN is an equivalent and readable alternative.

Examples

Example 1: Return the 3 smallest numbers

List.MinN({15, 3, 42, 8, 27, 1}, 3)
Result
Result
1{1, 3, 8}

Example 2: Return values while they are below a threshold

List.MinN({10, 20, 30, 40, 50}, each _ <= 30)
Result
Result
1{10, 20, 30}

Example 3: Find the 3 lowest-cost items

let
    Costs = {1200, 850, 3400, 450, 2100, 975},
    BottomThree = List.MinN(Costs, 3)
in
    BottomThree
Applied Steps

The final output — returns the 3 smallest cost values from the list, sorted in ascending order.

Result
1450
2850
3975

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks