Text.Upper
Converts all letters in a text value to upper case.
Text.Upper(text as nullable text, optional culture as nullable text) as nullable textReturns: The text in capitals, or null when the input is null.
What it does
Upper case is the standard form for many codes: currency codes, state abbreviations, SKU and account prefixes. When one source writes "usd" and another writes "USD", a join fails. Text.Upper puts every letter in capitals so that the two values match. It does not change digits or punctuation.
Syntax and arguments
- text: the value to convert.
- culture (optional): a culture name such as "tr-TR". Some languages change case in special ways, so pass a culture when the data is not English.
Example
Two bank feeds record currency codes in different cases. The team standardizes them before it joins to a rate table.
let
Feed = #table(
type table [Currency = text, Amount = number],
{{"usd", 1200}, {"Eur", 800}, {"GBP", 450}}
),
Standard = Table.TransformColumns(Feed, {{"Currency", Text.Upper, type text}})
in
Standard
The three codes come out as "USD", "EUR" and "GBP". Now they match the rate table, which is stored in capitals.
Example: a second, different use
Turn an account type entered as "asset" into "ASSET" so it groups with the balances that were keyed in upper case.
Things to watch
- Converting to upper case does not make a comparison ignore case in every function. Use Comparer.OrdinalIgnoreCase where the function accepts a comparer.
- Only letters change. "1099-nec" becomes "1099-NEC".
- Null in gives null out.
- For names, Text.Proper usually reads better than capitals.
In business terms
Currency codes, state codes and tax form names are compared in capitals in most finance systems. Standardizing the case on the way in saves a round of "why did the join miss" questions when a new bank feed arrives.