Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Uppercase: How to Capitalize Text Columns

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To convert text to uppercase in Power Query, select the column you wish to modify, go to the Transform tab, click Format, and select UPPERCASE. This operation instantly converts every character in the selected column to capital letters, ensuring data consistency for joins, filters, and reporting. This is a critical step for cleaning data where the same entity might be entered as "Apple", "apple", or "APPLE", which Power Query treats as three distinct values because it is case-sensitive.

What You'll Need

  • Microsoft Excel or Power BI Desktop installed on your machine.
  • A data source (CSV, Excel workbook, SQL database, or Web API) already connected to the Power Query Editor.
  • A column containing text-based data that requires standardization.

Step-by-Step

  1. Open the Power Query Editor: In Excel, go to the Data tab and select Get Data > Launch Power Query Editor. In Power BI, click Transform Data from the Home ribbon.
  2. Select the Target Column: Click the header of the column you want to convert to uppercase. To select multiple columns, hold the Ctrl key while clicking each header. Note that labels and menu paths may differ slightly depending on your specific version of Excel or Power BI.
  3. Navigate to the Transform Tab: Look at the top ribbon and click on the Transform tab. This tab contains tools that modify the existing data in the selected column.
  4. Access the Format Menu: In the Text Column group, find the Format button. Click the drop-down arrow associated with it.
  5. Apply Uppercase: From the drop-down list, select UPPERCASE. Power Query will immediately generate a new step in the Applied Steps pane called "Uppercased Text" (or similar), and all values in the column will change to all-caps.
  6. Verify the Results: Scroll through your data to ensure that special characters or numbers were not negatively impacted. Numbers and symbols remain unchanged, while all lowercase letters are converted.
  7. Load the Data: Once you are satisfied with the transformation, go to the Home tab and select Close & Apply (Power BI) or Close & Load (Excel) to bring the cleaned data into your worksheet or model.

Common Mistakes

One of the most frequent errors is applying the uppercase transformation after performing a merge or a join. Because Power Query is case-sensitive, merging a table where one column is "New York" and the other is "NEW YORK" will result in no matches. You must apply the uppercase format to both columns in both tables before attempting the merge to ensure the keys match perfectly.

Another common mistake is confusing the Transform tab with the Add Column tab. If you use the Transform tab, the original column is overwritten. If you need to keep the original casing for reference while having a capitalized version for analysis, you should navigate to the Add Column tab instead. Selecting Format > UPPERCASE from the Add Column tab creates a brand new column, leaving your source data intact.

Users also frequently forget to check the data type of the column. If a column is set to "Any" or "Number", the Format options may be greyed out or unavailable. Ensure the column is explicitly set to the Text data type by clicking the icon to the left of the column header before attempting to change the case.

Tips

For advanced users, you can perform this action using the formula bar if you prefer writing M code. The function used is Text.Upper([ColumnName]). If you are creating a custom column, you can wrap your existing logic in this function to ensure the output is always capitalized regardless of the input source.

When dealing with massive datasets, try to perform the uppercase transformation as early as possible in your query steps. This helps in standardizing the data before you apply complex filters or grouping operations, which can reduce the likelihood of duplicate groups caused by casing differences.

If you only need the first letter of each word capitalized, use the Capitalize Each Word option found in the same Format menu. This is often more appropriate for names or city titles, whereas full uppercase is typically reserved for IDs, SKU codes, or state abbreviations.

Troubleshooting

If the UPPERCASE option is greyed out, the most likely cause is that the column is not recognized as a text type. Check the data type icon (e.g., 1.2 or 123) in the column header. Click it and change it to Text. The Format options should now be active.

If you apply the transformation but the data does not seem to change in your final Excel sheet or Power BI report, check your Applied Steps pane. You may have accidentally added a step later in the sequence that reverts the column or replaces it with a different version of the data. Delete any redundant steps by clicking the X next to the step name.

If you encounter an error saying "We cannot convert the value to text", it means your column contains non-text values (like errors or nulls) that the function cannot process. To fix this, right-click the column and select Replace Errors to fill them with a blank string or a default value before applying the uppercase transformation.

If the data is not updating after you change the source file, remember that Power Query does not update in real-time. You must click Refresh on the Data tab in Excel or the Home tab in Power BI to trigger the sequence of steps, including the uppercase conversion, on the new data.

Frequently Asked Questions

Is Power Query case-sensitive?

Yes, Power Query is strictly case-sensitive. This means "Sales" and "sales" are viewed as two different values during filtering, grouping, and merging.

Can I convert only a specific part of a cell to uppercase?

The built-in Format menu converts the entire cell. To capitalize only a specific part, you must use a Custom Column with a combination of Text.Start, Text.Middle, and Text.Upper functions.

Does the uppercase function remove trailing spaces?

No, the uppercase transformation only changes the case of the letters. To remove extra spaces, you should use Format > Trim before or after applying the uppercase setting.

Can I undo the uppercase transformation?

Yes. In the Applied Steps pane on the right side of the editor, find the step named "Uppercased Text" and click the X icon to its left to remove the transformation and restore the original casing.

Will this change the data in my original source file?

No. Power Query is a non-destructive tool. It reads the data from the source and applies transformations in a virtual layer. Your original CSV or Excel file remains completely unchanged.