List.Mode
ListReturns the most frequently occurring value in the list. If there is a tie, returns the first mode encountered.
Syntax
List.Mode(list as list, optional equationCriteria as any) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list to find the mode of. |
equationCriteria | any | No | An optional equation criteria to control how equality is determined when finding duplicate values. |
Return Value
any — The most frequently occurring value in the list.
Remarks
List.Mode returns the single value that appears most frequently in the list — the statistical mode. If multiple values are tied for the highest frequency, it returns the first tied value encountered in the original list order. To retrieve all tied modes, use List.Modes instead.
Null values are counted as occurrences and can be returned as the mode if null appears more frequently than any other value. Comparison is case-sensitive for text by default; pass Comparer.OrdinalIgnoreCase as the optional equationCriteria for case-insensitive mode detection. An empty list causes an error — guard with List.IsEmpty if needed.
List.Mode returns a single scalar value, not a list. This makes it directly usable in expressions without indexing. Common uses include finding the most common category, the most frequent response in survey data, or the most popular product in a transaction log.
Examples
Example 3: Most common category in a dataset
let
Categories = {"Electronics", "Clothing", "Electronics", "Books", "Clothing", "Electronics"},
MostCommon = List.Mode(Categories)
in
MostCommonThe final output — returns the most frequently occurring value in the Categories list, which is "Electronics" with 3 occurrences.
Result | |
|---|---|
| 1 | Electronics |