If you want to convert text to lowercase in Power Query, so that values match no matter how they were typed, Text.Lower is the function you reach for. In this article, I’ll show you how to use Text.Lower with a few simple examples.
Syntax of Text.Lower Function
Text.Lower(text as nullable text, optional culture as nullable text) as nullable text
where
text(required, nullable text). The text value you want to convert to lowercase.culture(optional, nullable text). A culture name like"en-US"that controls the casing rules. Omit it to use the default casing.
Returns: a nullable text value with every character converted to lowercase. If text is null, it returns null.
In plain terms, you hand it a piece of text and it gives you back the same text with all the letters in lowercase.
Example 1: Convert a text value to lowercase
Take a value with mixed casing and push the whole thing to lowercase.
let
Source = Text.Lower("HELLO World")
in
Source
Result: hello world
Every letter is converted, so HELLO World becomes hello world.
Example 2: Lowercase an email column
Lowercasing an email column is one of the most common uses of Text.Lower. Email addresses are not case-sensitive, so storing them in a single case keeps them consistent.
Say you have a Subscribers query with a Name and an Email column.
You want every email in lowercase, while leaving the names untouched.
Here is the starting data:
| Name | |
|---|---|
| Megan Calhoun | Megan.Calhoun@GMAIL.com |
| Rohit Sharma | Rohit_Sharma@Outlook.COM |
| David Whitfield | DWhitfield@COMPANY.io |
Now apply Text.Lower to just the Email column with Table.TransformColumns:
let
Source = Excel.CurrentWorkbook(){[Name="Subscribers"]}[Content],
#"Lowercased Email" = Table.TransformColumns(Source,{{"Email",Text.Lower,type text}})
in
#"Lowercased Email"
This converts each value in Email to lowercase and leaves the Name column as it was.
The result keeps the names and lowercases the emails:
| Name | |
|---|---|
| Megan Calhoun | megan.calhoun@gmail.com |
| Rohit Sharma | rohit_sharma@outlook.com |
| David Whitfield | dwhitfield@company.io |
Example 3: Match rows regardless of case
Text.Lower is handy when you need a case-insensitive filter. By lowercasing both sides of a comparison, you catch every variation of how a value was entered.
Say you have an Orders query and you want only the rows marked active, no matter how the status was typed. This pairs well with a text check like Text.Contains when you match on a partial value.
Here is the starting data:
| OrderID | Status |
|---|---|
| ORD-1001 | Active |
| ORD-1002 | ACTIVE |
| ORD-1003 | Cancelled |
| ORD-1004 | active |
Lowercase the Status value inside Table.SelectRows, then compare it to "active":
let
Source = Excel.CurrentWorkbook(){[Name="Orders"]}[Content],
#"Active Orders" = Table.SelectRows(Source,each Text.Lower([Status]) = "active")
in
#"Active Orders"
This keeps every row whose status reads active once it is lowercased.
The result has all three active orders:
| OrderID | Status |
|---|---|
| ORD-1001 | Active |
| ORD-1002 | ACTIVE |
| ORD-1004 | active |
The Cancelled row is dropped, while Active, ACTIVE, and active all pass.
Example 4: Pass a null value
If the value you pass might be blank, it helps to know what Text.Lower does with null.
let
Source = Text.Lower(null)
in
Source
Result: null
A null input returns null instead of throwing an error, so a blank cell passes straight through.
Things to keep in mind with Text.Lower
- It only changes letters. Numbers, spaces, punctuation, and symbols pass through unchanged, so
Text.Lower("ORD-1001")staysord-1001. - The input must be text. A number throws
Expression.Error: We cannot convert the value 42 to type Text.Convert it first withText.From. The same rule applies to siblings likeText.StartsWith. - Use the
cultureargument for locale-specific letters. Some languages lowercase certain characters differently. Pass a culture like"tr-TR"when the default casing gives the wrong result. - Comparisons against the result are still case-sensitive.
Text.Loweronly changes the value. The=operator compares exactly, which is why Example 3 lowercases the column before matching it to a lowercase literal.
Common questions about Text.Lower
What is the difference between Text.Lower and Text.Upper?
Text.Lower converts every letter to lowercase, while Text.Upper converts every letter to uppercase. The arguments and null behavior are the same for both.
How do I lowercase only the first letter or capitalize each word?
Text.Lower always affects the whole string. For title casing use Text.Proper, and for sentence-style casing combine Text.Lower with Text.Start and Text.Upper. To swap specific words after normalizing case, reach for Text.Replace.
List of All Power Query Functions
Related Power Query Functions / Articles: