Power Query List.Min Function: How to Find the Smallest Value
In this article
The List.Min function in Power Query returns the smallest value from a list of numbers or dates. It is useful for quickly identifying minimum values in datasets without manual scanning. No setup is required beyond having a list of comparable values in Power Query.
What You'll Need
- A Power Query environment (available in Excel, Power BI, or SQL Server Data Tools)
- A column or custom list containing numeric values or dates
- Basic familiarity with Power Query Editor (opening, transforming, and adding columns)
Step-by-Step
- Open your data in Power Query Editor: In Excel, go to Data > Get & Transform Data > From Table/Range. In Power BI, select your table and click Transform Data.
- Ensure your data is in a single column of numeric values or dates. If it’s text, convert it using the Transform > Data Type > Whole Number or Decimal Number option. Dates must be in Date or DateTime format.
- Create a new custom column: Click Add Column > Custom Column. In the formula box, type
List.Min(YourColumnName)whereYourColumnNameis the exact name of the column you want to evaluate. For example, if your column is namedSales, typeList.Min(Sales). - Press OK. The new column will display the smallest value from the entire list in every row. This is because List.Min operates on the entire column, not row-by-row.
- Optionally, remove original columns: Right-click any columns you no longer need and select Remove. Keep only the original data and the new List.Min result.
- Apply changes: Click Close & Load to return the result to your worksheet or report.
Common Mistakes
- Using List.Min on a column with text values — this causes an error because text cannot be compared numerically. Always convert to Number or Date first.
- Typing the column name incorrectly — Power Query is case-sensitive and requires exact spelling. Double-check the column name in the Applied Steps pane.
- Assuming List.Min works per row — it evaluates the entire column at once. If you need the minimum per group, use Group By first.
- Forgetting to handle nulls — if your column contains null values, List.Min will return null. Use List.Select to filter out nulls before applying List.Min.
- Applying it to an empty list — if the column has no values, List.Min returns null. Always verify data integrity before running the function.
Tips
- To find the minimum after filtering, apply your filters first, then use List.Min. The function will only consider visible rows after filtering.
- Combine List.Min with List.Select to exclude nulls:
List.Min(List.Select(YourColumn, each _ <> null))ensures accurate results. - For dynamic lists, use List.Min with a reference to a custom list created via List.Generate or List.Combine.
- Use List.Min with List.Distinct if duplicates are irrelevant:
List.Min(List.Distinct(Sales))improves performance on large datasets. - Store the result in a variable using
letsyntax for reusable logic:MinValue = List.Min(Sales), then reference MinValue elsewhere.
Troubleshooting
- If you see Expression.Error: We cannot convert a value of type Text to type Number, open the column’s data type and select Number or Decimal Number. If conversion fails, check for non-numeric characters like commas, dollar signs, or letters — remove them using Replace Values or Text.Remove.
- If List.Min returns null, check for nulls in the source data. Use the filter dropdown on the column header and uncheck "null" to see if any data remains. If not, your dataset may be empty.
- If the result seems incorrect, verify the column’s data type. A date formatted as text will not compare correctly. Convert to Date using Transform > Data Type > Date.
- If the function is not recognized, ensure you are using the correct syntax:
List.Min(capital L, capital M), notlist.minorListMin. - If you’re working with a grouped table, List.Min won’t work unless applied within a Group By transformation. Create a new step after grouping: Group by your category, then add an aggregation using List.Min on the numeric column.
- Restart Power Query Editor or Excel if the function appears to behave erratically. Sometimes the query engine needs a refresh.
Frequently Asked Questions
Can List.Min handle negative numbers?
Yes. List.Min correctly identifies the most negative number as the smallest value — for example, -50 is smaller than -5.Does List.Min work with dates?
Yes. It returns the earliest date in the list. This is useful for finding the first transaction date or earliest record.What happens if the list is empty?
List.Min returns null. Always validate your data source has values before applying this function.Can I use List.Min with text values?
No — text strings are not comparable numerically. Power Query will throw an error. Use List.Min on numbers or dates only.How is List.Min different from Table.MinColumn?
List.Min operates on a single column of values and returns one result. Table.MinColumn returns the entire row with the minimum value in a specified column — it’s useful if you need to preserve other fields from that row.Can I use List.Min in a conditional column?
Yes. For example, you can create a column that says "Lowest" if the row’s value equals List.Min(YourColumn), otherwise "Other". Use a custom column with an if statement:if [Sales] = List.Min(Sales) then "Lowest" else "Other".