Comparer.FromCulture
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns a comparer function given the culture and a logical value for case sensitivity for the comparison. The default value for ignoreCase is false. The value for culture are well known text representations of locales used in the .NET framework.
Comparer.FromCulture(culture as text, optional ignoreCase as nullable logical) as function
| Argument | Description |
|---|---|
| culture | A text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference. |
| optional ignoreCase | Logical value whether or not to ignore the case. |
let
comparer1 = Comparer.FromCulture("en-us", false),
comparer2 = Comparer.FromCulture("en-us", true)
in
[
Test1 = comparer1("a","A"), equals -1
Test2 = comparer2("a","A") equals 0
]
Show: