Daily DAX : Day 401 UPPER
Power BI DAX Function: UPPER
Syntax
UPPER(<text>)
Description
The UPPER function converts all letters in a text string to uppercase. Non-letter characters (numbers, spaces, symbols) remain unchanged.
Parameters
| Parameter | Description |
|---|---|
| <text> | A text string or a column containing text |
Return Value
A text string with all letters converted to uppercase.
Common Use Cases
- Standardizing data for lookups – Ensure consistent matching regardless of original case (e.g., "USA", "usa", "UsA" → all become "USA")
- Creating case-insensitive keys for relationships or merging queries
- Data cleansing – Make customer names, product codes, or categories appear uniform in reports
- Sorting consistency – When combined with sorting, uppercase ensures predictable alphabetical order
Examples
1. Simple Calculated Column
Customer Name Upper = UPPER(Customers[CustomerName])
| CustomerName | Customer Name Upper |
|---|---|
| john doe | JOHN DOE |
| Alice Smith | ALICE SMITH |
| bob123 | BOB123 |
2. Case-Insensitive Lookup (Common Scenario)
Country Match =
LOOKUPVALUE(
Countries[Region],
Countries[CountryCode], UPPER(Sales[ShipCountry])
)
This ensures the lookup works even if Sales[ShipCountry] has mixed case like "usa", "USA", or "UsA".
3. Measure Example
Upper Product Category =
CONCATENATEX(
VALUES(Products[Category]),
UPPER(Products[Category]),
", "
)
Returns: BEVERAGES, CONDIMENTS, SEAFOOD
Tips
- Use
UPPERtogether withLOWERorEXACTfor case-insensitive comparisons. - Avoid applying
UPPERrepeatedly in measures if performance matters — consider creating a calculated column instead.
Related Functions: LOWER(), PROPER(), EXACT(), FIND() / SEARCH()
Comments
Post a Comment