Downloads
Power Query MTextBeginner

Text.Upper

Converts all letters in a text value to upper case.

Syntax
Text.Upper(text as nullable text, optional culture as nullable text) as nullable text

Returns: 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

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

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.

Related functions

All Power Query M functions · View as Markdown · M basics