List.Min
ListReturns the minimum value from a list.
Syntax
List.Min(list as list, optional default as nullable any, optional comparisonCriteria as any, optional includeNulls as nullable logical) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list to search. |
default | any | No | Value returned when the list is empty. Defaults to null. |
comparisonCriteria | any | No | A comparer or key selector for custom ordering. |
includeNulls | logical | No | Whether to include null values in the comparison. Defaults to false. |
Return Value
any — The smallest value in the list, or the default value if the list is empty.
Remarks
List.Min returns the smallest value in a list. Null values are excluded from comparison by default. If the list is empty, null is returned unless a default value is provided.
The optional comparisonCriteria parameter accepts a comparer function or a key selector (for example, each Text.Length(_) to find the shortest text).
Use List.Min on a table column by first extracting it with Table.Column.
Examples
Example 2: Find the earliest date in a column
let
Dates = Table.Column(Sales, "OrderDate"),
Oldest = List.Min(Dates)
in
#table({"EarliestOrder"}, {{Oldest}})Applied Steps
The final output — wraps the earliest date into a single-row table with an "EarliestOrder" column header.
EarliestOrder | |
|---|---|
| 1 | 1/15/2024 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks