Text.Proper is a Power Query M function that capitalizes the first letter of each word in a text value, with all other letters in lowercase. The function returns the modified text value, with an optional culture parameter to customize the conversion.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Text.Proper(
text as nullable text,
optional culture as nullable text,
) as nullable text
Argument | Attribute | Description |
---|---|---|
text | The string that will be transformed. This function adjusts the text so that the first letter of each word is capitalized, and the remaining characters are in lowercase. | |
culture | optional | The culture argument enables the specification of a Culture code (e.g., “nl-NL” or “en-US”) to align transformations with local formatting conventions. If this argument is omitted, functions default to Culture.Current, which reflects the system’s regional settings. |
Description
The Text.Proper function capitalizes only the first letter of each word it receives. All other letters are returned in lowercase. An optional culture
can also be provided (for example, “en-US”).
Examples
Let’s explore how this function works with some examples.
Capitalizing Each Word
You can provide a sentence as single argument to the Text.Proper
function. Doing that capitalizes each words in the sentence.
// Output: "Old Mcdonald Had A Farm, Hiahiahoo"
Text.Proper( "old MCDonald Had A FArm, HiaHiAHOO" )
Handling Different Languages
Some languages treat capitalization differently than others. To instruct which local convention to use when formatting values, you can specify an optional culture parameter. Take for example the following example.
// Output: "You And I Are Different"
Text.Proper( "You and i are different", "en-US")
In the English language the word “i” is capitalized to “I”. However, the Turkish alphabet treats this letter differently.
// Output: "You And İ Are Different"
Text.Proper( "You and i are different", "tr-TR")
In Turkish alphabet the letter “İ” is the capital version of “i”. So depending on your needs, you can use the relevant culture-code for capitalizing words.
Related articles
Learn more about Text.Proper in the following articles:
- Text Functions in Power Query M (150+ Examples)
Your guide to Text Functions in Power Query M. Learn from practical examples and master Power Query’s most useful Text functions. » Read more
Related functions
Other functions related to Text.Proper are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy