Smart Systems for Home

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

Power Query Excel Online: How to Clean and Transform Data

· 7 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

Power Query in Excel Online allows you to import, clean, and reshape data from various sources directly in your web browser without needing the desktop application. It achieves this by creating a series of repeatable transformation steps—such as removing duplicates, splitting columns, or filtering rows—that can be refreshed whenever the source data changes, ensuring your reports remain accurate and up to date. To get started, you simply need a Microsoft 365 subscription and a workbook stored in OneDrive or SharePoint.

What You'll Need

  • A Microsoft 365 account with a license that includes Excel for the web.
  • A web browser (such as Microsoft Edge, Google Chrome, or Mozilla Firefox).
  • An internet connection to access OneDrive or SharePoint.
  • A data source, which can be another Excel workbook, a CSV file, or a web-based table.

Step-by-Step

Note that menu labels may differ slightly depending on your region, browser version, or specific Microsoft 365 update cycle.

  1. Open your Workbook: Sign in to your Microsoft account and open Excel Online. Create a new blank workbook or open an existing one stored in OneDrive or SharePoint.
  2. Access the Data Tab: Click on the Data tab in the top ribbon. This is where all the connectivity and transformation tools are located.
  3. Get Data: Click on the Get Data button. A dropdown menu will appear showing the available sources. Common options include "From Table/Range" (if your data is already in the current sheet) or "From File" (to pull in external CSVs or other Excel files stored in the cloud).
  4. Select Your Source: If you chose "From Table/Range," highlight the range of cells you want to transform and confirm. If you chose an external file, navigate your OneDrive folders, select the file, and click Open.
  5. Launch the Power Query Editor: Once the data is selected, Excel Online will open the Power Query Editor in a separate overlay or window. This environment is distinct from the standard spreadsheet view and is where all the "cleaning" happens.
  6. Inspect the Data: Review the preview of your data. Power Query automatically attempts to detect data types (e.g., Date, Text, Decimal Number) for each column. If a column is incorrectly identified, click the icon next to the column header and select the correct data type.
  7. Remove Unnecessary Columns: To keep your dataset lean, select the columns you do not need by holding Ctrl and clicking the headers. Right-click any of the selected headers and choose Remove Columns.
  8. Filter Rows: Click the filter arrow in a column header. Uncheck the values you want to exclude (such as blank rows or "N/A" entries) and click OK. This ensures only relevant data reaches your final table.
  9. Split Columns: If you have a column containing combined data (like "First Name Last Name"), right-click the column header, select Split Column, and choose By Delimiter. Select the space or comma that separates the data and click OK.
  10. Format Text: To ensure consistency, right-click a text column, select Transform, and choose Uppercase, Lowercase, or Capitalize Each Word. This prevents duplicate entries caused by inconsistent casing.
  11. Replace Values: If there are errors or outdated terms in your data, right-click the column and select Replace Values. Enter the text you want to find and the text you want to replace it with.
  12. Review Applied Steps: Look at the Query Settings pane on the right side of the screen. Every action you took is listed under "Applied Steps." If you make a mistake, click the X icon next to the specific step to undo it without starting over.
  13. Close and Load: Once the data is cleaned, click the Close & Load button in the top left corner. Power Query will process the steps and load the transformed data into a new table in your Excel Online worksheet.

Common Mistakes

One of the most frequent errors is forgetting to verify data types before performing calculations. For example, if a price column is formatted as "Text," you cannot sum the values. Always check the data type icon (e.g., 1.2 or ABC) in the column header before proceeding to the load phase.

Another common mistake is deleting the source file or moving it to a different folder in OneDrive. Power Query does not store the data itself; it stores the instructions on how to get the data. If the path to the source file changes, the query will break, and you will see a "Data Source Not Found" error upon refreshing.

Users often try to perform manual edits in the final Excel table after loading the data. While this is possible, any manual changes made to the table cells will be overwritten the next time the query is refreshed. All permanent changes must be made within the Power Query Editor steps, not in the spreadsheet cells.

Lastly, many users overlook the "Applied Steps" pane. Instead of undoing every action manually, they restart the entire process. Learning to navigate the step list allows for surgical corrections to the data transformation pipeline.

Tips

To maximize efficiency, use the "Trim" function. Right-click a text column, go to Transform, and select Trim. This removes invisible leading and trailing spaces that often cause lookup errors (VLOOKUP or XLOOKUP) in the final spreadsheet.

If you are working with very large datasets, filter your data as early as possible in the "Applied Steps" sequence. By removing unnecessary rows at the start, Power Query processes less data in the subsequent steps, which improves performance and reduces loading times in the browser.

Utilize the "Group By" feature for quick summaries. Instead of loading thousands of rows of raw data, you can use Group By in the editor to aggregate data (e.g., total sales per region) before loading it into the sheet. This keeps your workbook size manageable.

Create a naming convention for your queries. In the Query Settings pane, rename your query from "Table1" to something descriptive like "Quarterly_Sales_Cleaned." This is essential when your workbook begins to use multiple data sources.

Troubleshooting

If the Get Data button is greyed out or missing, first check that your file is saved in a cloud location (OneDrive or SharePoint). Power Query for the web generally does not work with files saved locally on your hard drive unless they are uploaded to the cloud first.

If you encounter a "Refresh Failed" error, the most likely cause is a change in the source data structure. For example, if you renamed a column in the source CSV file, Power Query will look for the old name and fail. To fix this, open the Power Query Editor, find the step where the error occurs (indicated by a red exclamation mark), and update the column reference or remove that step and re-add it.

If the browser becomes unresponsive during a large data load, try clearing your browser cache or switching to a browser with more allocated memory. Alternatively, go back into the editor and apply more aggressive filters to reduce the number of rows being loaded into the worksheet.

If the data types are not updating despite your changes, try clicking Refresh Preview in the editor. Sometimes the preview doesn't reflect the most recent transformation step until a manual refresh is triggered.

Frequently Asked Questions

Can I use Power Query Excel Online for free?

Power Query is available to users with a Microsoft 365 subscription. While there is a free version of Excel for the web, advanced data connectivity features may be limited depending on the specific account type.

Is Power Query Online the same as the Desktop version?

It is very similar, but the desktop version is more powerful. The desktop version supports a wider range of data connectors (like local SQL servers) and more advanced M-code scripting that may not be available in the web interface.

How do I refresh the data after the source file changes?

Right-click anywhere inside the loaded data table in your worksheet and select Refresh. Excel will re-run all the Applied Steps in the background and update the table with the newest data.

Can I merge two different tables in Excel Online?

Yes. In the Power Query Editor, you can use the Merge Queries feature to join two tables based on a common column, similar to a JOIN in SQL or a VLOOKUP in Excel.

Will my Power Query steps work if I open the file in the desktop app?

Yes, queries created in Excel Online are generally compatible with the Excel desktop application. You can switch between the two environments seamlessly as long as the file remains in the cloud.

Can I connect to a website's table using Power Query Online?

Yes, by selecting Get Data and choosing the web source option. You provide the URL, and Power Query will analyze the page to identify any HTML tables that can be extracted.