List.Modes

List

Returns all values that appear with the highest frequency in the list (all modes when there is a tie).

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

Syntax

List.Modes(list as list, optional equationCriteria as any) as list

Parameters

NameTypeRequiredDescription
listlistYesThe list to find all modes of.
equationCriteriaanyNoAn optional equation criteria to control how equality is determined.

Return Value

listA list of all values tied for the highest frequency.

Remarks

List.Modes returns a list of all values that share the maximum frequency in the input list. When there is only one most-frequent value, it returns a single-element list. When multiple values tie for the highest frequency, all tied values are returned.

This is the multi-value counterpart of List.Mode. Use List.Modes when you need to detect whether a dataset is multimodal (has ties) or when downstream logic must handle all equally common values. If you only need one mode and ties are not a concern, List.Mode returns a scalar directly, which is simpler to use.

The order of modes in the result follows their first appearance in the source list. Null values count as occurrences and can be included in the result. An empty list causes an error — guard with List.IsEmpty if needed. Comparison is case-sensitive for text by default; pass Comparer.OrdinalIgnoreCase as the optional equationCriteria argument for case-insensitive frequency grouping.

Examples

Example 1: Single mode

List.Modes({1, 2, 2, 3, 3, 3, 4})
Result
Result
1{3}

Example 2: Multiple tied modes

List.Modes({1, 2, 2, 3, 3, 4})
Result
Result
1{2, 3}

Example 3: Detect tied categories

let
    Categories = {"A", "B", "A", "B", "C"},
    AllModes = List.Modes(Categories)
in
    AllModes
Applied Steps

The final output — a list of all tied mode values from the Categories list.

Result
1{A, B}

Compatibility

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