Power Query connectors let you pull data from hundreds of sources—databases, web pages, files, cloud services—into Excel or Power BI without writing code. The built-in connectors handle authentication and data shaping, so you can focus on analysis. To get started, you need a supported version of Excel (2016 or later, or Microsoft 365) or Power BI Desktop, and the necessary credentials for your data source.
What You'll Need
- Excel 2016 or later, or Power BI Desktop (the steps below use Excel; Power BI is similar but labels may differ).
- Credentials for the data source you want to connect to (username/password, API key, OAuth account, etc.).
- For on-premises sources, a gateway may be required if you plan to refresh in the cloud.
- Stable internet connection for cloud-based sources.
Step-by-Step
- Open Power Query Editor. In Excel, go to the Data tab and click Get Data (or Get & Transform Data in older versions). In Power BI Desktop, click Home > Get Data. This opens the connector browser.
- Choose your connector. Browse categories (File, Database, Azure, Online Services, Other) or use the search box. For example, select From Web for a web page, From SQL Server for a database, or From SharePoint Online List for a SharePoint list. Labels may vary slightly by version.
- Enter connection details. Provide the required information—URL, server name, file path, etc. For databases, you may need to specify a database name and optionally a SQL query. Click OK.
- Authenticate. Choose an authentication method (Windows, Basic, Web API, Organizational account, etc.). Enter credentials and click Connect. For OAuth sources, you'll be prompted to sign in via a browser window.
- Select data. In the Navigator dialog, browse the available tables, sheets, or lists. Check the boxes for the items you want, then click Transform Data to open the Power Query Editor for cleaning, or Load to import directly into a worksheet or data model.
- Shape the data (optional). In the Power Query Editor, use the ribbon to remove columns, filter rows, change data types, split columns, and more. Each action is recorded as a step in the Applied Steps pane on the right.
- Load the data. When finished, click Close & Load (Excel) or Close & Apply (Power BI). The data is imported into a new worksheet or the data model.
- Set refresh options. In Excel, right-click the loaded table and choose Table > Refresh to update manually, or go to Data > Queries & Connections to set refresh properties (e.g., refresh every 60 minutes). For cloud refresh, you may need to configure a gateway.
Common Mistakes
- Ignoring data type changes. Power Query often guesses types incorrectly (e.g., text as number). Always review and set types explicitly to avoid errors in calculations.
- Loading more data than needed. Selecting entire tables when you only need a few columns slows refresh and bloats files. Use the Navigator to preview and filter before loading.
- Forgetting credentials. If a refresh fails, check that your credentials haven't expired or been revoked, especially for OAuth sources.
- Using the wrong connector. For example, using From Web for a SharePoint list instead of the dedicated SharePoint connector can cause authentication issues.
- Not handling errors. Steps like removing columns can fail if the source schema changes. Use error-handling options or keep steps flexible.
Tips
- Use parameters to make queries reusable—e.g., a parameter for a server name or date range.
- Document your steps by renaming them in the Applied Steps pane for clarity.
- Test with a small subset before loading large datasets to ensure the query works as expected.
- Leverage the formula bar to edit M code directly for advanced transformations.
- Keep queries organized in folders (right-click in the Queries pane) for easier management.
Troubleshooting
If a connection fails, start with the simplest checks: verify your internet connection, confirm the source is online, and ensure your credentials are correct. For authentication errors, try signing out and back in. If the data doesn't refresh, check the query's refresh settings and whether a gateway is needed for cloud refresh. For schema changes (e.g., a column renamed), edit the query steps to accommodate the new structure. If you encounter a formula error, use the Error column to identify problematic rows and filter them out or fix the data type.
If the connector isn't listed, ensure you're using a version that supports it—some connectors require updates. For on-premises data, confirm the gateway is installed and running. When all else fails, consult the official Microsoft documentation for connector-specific guidance.
Frequently Asked Questions
Can I connect to multiple data sources in one query?
Yes, you can combine data from different sources by merging or appending queries in the Power Query Editor.
Do I need a gateway for cloud data sources?
No, gateways are only required for on-premises data sources when refreshing from the cloud (e.g., Power BI service).
How do I update a query if the source structure changes?
Open the Power Query Editor, review the Applied Steps, and adjust steps like Changed Type or Removed Columns to match the new structure.
What's the difference between Load and Transform Data?
Load imports data directly; Transform Data opens the editor for cleaning before loading.
Can I use Power Query connectors in Excel for Mac?
Yes, most connectors are available in Excel for Mac, but some may be limited or require different authentication methods. Check Microsoft's documentation for specifics.