Comparer.OrdinalIgnoreCase

Comparer

A case-insensitive ordinal comparer function.

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

Syntax

Comparer.OrdinalIgnoreCase as function

Return Value

functionA comparer function that performs case-insensitive ordinal comparisons.

Remarks

Comparer.OrdinalIgnoreCase is a built-in comparer function that performs case-insensitive ordinal comparisons. It treats uppercase and lowercase versions of the same letter as equal (e.g., "A" equals "a").

This comparer is commonly used with List.Distinct to deduplicate text that differs only by casing, and with List.Sort or Table.Sort to produce case-insensitive sorted results.

Examples

Example 1: Case-insensitive distinct on employee names

let
    Names = Table.Column(Employees, "FullName"),
    NamesWithDup = List.Combine({Names, {"ALICE SMITH"}}),
    Unique = List.Distinct(NamesWithDup, Comparer.OrdinalIgnoreCase)
in
    #table({"FullName"}, List.Transform(Unique, each {_}))
Result
FullName
1alice smith
2BOB JONES
3Charlie Brown
4diana PRINCE
5Eve Martinez
6frank lee

Compatibility

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