
Have you ever connected Power BI Desktop to an Excel file in OneDrive for Business, published your report to Microsoft Fabric, and then found that refresh needs an on-premises data gateway? The file is in the cloud, so why does Power BI need a gateway to reach it?
The answer may be hiding in the file path. OneDrive and SharePoint Online can synchronise files to your computer. If you select the synchronised file from File Explorer, Power BI may be reading the local copy, even though the same file is also available in the cloud.
In this blog, I explain how to check the connection, show two ways to get the direct cloud URL, and connect to the workbook from Power BI Desktop. We also look at what changes with the new Power Query experience, including a useful diagram view that I quite like.
You can watch the complete demonstration on my YouTube channel:
Excel is in OneDrive, but why Power BI Still Wants a Gateway?
If you prefer listening, I have also published an AI generated podcast version of the video:
Excel Is in OneDrive, So Why Does Power BI Need a Gateway?
The examples use OneDrive for Business and SharePoint Online. The new Power Query experience was in public preview in the Power BI Desktop version shown in the video, so the interface and available features may change.
A Cloud File Can Still Have a Local Path #
Check out the video on YouTube at 1:46
When you synchronise OneDrive for Business or a SharePoint Online document library with your computer, the files appear in File Explorer. That is convenient, but the path you select there may look like this:
C:\Users\YourName\OneDrive - Your Organisation\Reports\Sales.xlsx
This is a local file path. Power BI Desktop can read it because the file is available on your computer. But after publishing, the Power BI service cannot simply browse your computer’s C drive. Refreshing that local file source requires a suitable gateway and access to the file from the gateway machine.
The cloud URL for the same workbook looks different. It starts with https:// and points to the file in OneDrive for Business or SharePoint Online. With a direct cloud connection and appropriate credentials, this Excel source can refresh without an on-premises data gateway.
To check what Power BI is using, open Data source settings in Power BI Desktop and look at the source for the workbook. In my example, the path starts with C:\Users, which tells me that Power BI is reading a local synchronised copy.

The source path in my example points to the local computer, even though the workbook is also in OneDrive.
The gateway requirement applies to the source and the wider semantic model configuration. If your model has other on-premises sources, changing this Excel connection to a cloud URL does not remove their gateway requirements. The example in this post uses an .xlsx workbook. Some legacy Excel formats, such as .xls and .xlsb, can also need a gateway because they require the Access Database Engine. Microsoft explains this in the Excel connector documentation and covers gateway scenarios in its Power BI data refresh documentation.
If you do need a gateway for other sources, I discuss planning and testing an enterprise gateway in Preparing On-premises Data Gateway Implementation Plans for Enterprises. The post is older, so some screens and product names may have changed.
Get the Cloud URL for the Excel File #
Check out the video on YouTube at 2:49
There are two methods I use to get the direct URL for the workbook. Both start from the file in OneDrive for Business or a SharePoint Online document library. You need access to the file with your organisational account.
Before we start, a small but important point: the Share or Copy link option can give you a sharing link rather than the direct file path needed for the connection shown here. In my example, I use one of the following methods to get the direct path instead.
Method 1: Copy the Path from Excel Desktop #
Check out the video on YouTube at 3:20
This method requires the Excel desktop application. Open OneDrive for Business or the SharePoint Online document library in your browser, find the workbook, and follow these steps:
- Select the ellipsis next to the Excel file.
- Select Open > Open in app.

- In Excel Desktop, select File > Info.
- Select Copy path.

The option is Copy path, not Copy local path. In my example, Excel copies the cloud URL with ?web=1 at the end. We remove that suffix when using the Web connector in the next section.
Connect Using the Web Connector #
Check out the video on YouTube at 3:52
With the cloud path copied, open Power BI Desktop and follow these steps:
- Select Get data > Web.
- Paste the copied path into the URL field.
- If the copied path ends with
?web=1, remove that suffix so the URL ends with the workbook name, such as.xlsx. - Select OK.

For example, the path I pasted had this shape before removing the suffix:
https://contoso.sharepoint.com/sites/Finance/Shared%20Documents/Sales.xlsx?web=1
After removing ?web=1, the URL points to the workbook path ending in Sales.xlsx. If you are connecting for the first time, select Organisational account, sign in with an account that can access the file, and select Connect. You can then select the worksheets or tables you want to use.
In my test, the file opened through its cloud URL. This is the same general approach I described in my 2021 blog post about connecting to Excel files in SharePoint Online. It is nice to see that the method is still useful.
Method 2: Copy the Direct Link from the Details Pane #
Check out the video on YouTube at 4:59
You can also get the direct file link from the browser without opening the workbook in Excel Desktop. Find the file in OneDrive for Business or the SharePoint document library and follow these steps:
- Select the ellipsis next to the file and open Details.
- Scroll down the details pane to Path.
- Select the copy icon next to Path. Its tooltip says Copy direct link.

Go back to Power BI Desktop, select Get data > Web, and paste the direct link. This link did not have the ?web=1 suffix, so I could use it without removing anything. Sign in with your organisational account if Power BI asks for credentials, then select the worksheets or tables you need.
Both methods get us to the same place: Power BI connects to the workbook using its cloud location. The second method is handy when you do not want to open the Excel desktop app just to copy the path.
If you already have a model using the local file, update the existing queries to use the cloud source, or replace them with the new cloud-based queries. Adding a new connection alone does not change the existing local source. Check Data source settings again to make sure the queries you need no longer reference the local path.
Check the Connection After Publishing #
Check out the video on YouTube at 5:58
Once you have connected to the cloud file and published your solution, check the semantic model settings in the Power BI service:
- In the workspace, select the ellipsis next to the semantic model and open Settings.
- Expand Gateway and cloud connections and check how the Excel source is mapped.
- Review the cloud connection or data source credentials and sign in if required.
- Run a refresh and check the refresh history to confirm that it completed successfully. Configure a refresh schedule if you need one.
In the example I show in the video, the Web source is mapped to a cloud connection and the on-premises or VNet gateway switch is off. My example also contains a separate SharePoint source, so you can see more than one cloud connection in the settings.

The Web connection to the Excel file appears under cloud connections in my published semantic model.
The connection settings are useful evidence of how the source is configured. They do not by themselves prove that a refresh has succeeded, so it is still a good idea to run one and check the result. For more details, see Configure scheduled refresh. I also discuss managing and sharing connections in Microsoft Fabric Connections Demystified. The interface and available features may have changed since I wrote that post.
What Changes in the New Power Query Experience? #
Check out the video on YouTube at 6:41
You may have noticed that I used the Web connector rather than selecting Excel workbook. In the older Power Query experience demonstrated in the video, the Excel workbook option opened a local file selection dialog, so I used the Web connector for the online file.
In the new experience, the Excel workbook connector provides a field where I could paste the cloud URL directly. This feels more natural when the data source is an Excel workbook. The experience is also familiar if you have worked with Power Query Online in dataflows.
Enable the New Experience #
Check out the video on YouTube at 9:11
In the version I used, follow these steps in Power BI Desktop:
- Open File > Options and settings > Options. You can also use the settings button shown in the video.
- Under Global, select Preview features.
- Select New Power Query experience.
- Select OK.

In my test, I could switch the experience without restarting Power BI Desktop when I had one instance open. As this was a preview feature in the demonstrated version, check the options available in your own version and the known limitations.
Connect with the Excel Workbook Connector #
Check out the video on YouTube at 8:04
With the new experience enabled, use the direct file URL you copied earlier:
- In Power BI Desktop, select Get data > Excel workbook.
- Paste the direct cloud URL into the File path field in the connection form.
- Select Organisational account for authentication and sign in. In my example, I also set the privacy level to Organisational.
- Select Next, then choose the worksheets or tables you want to use.

In the video, I pasted the URL into the connection form and Power Query opened the workbook. Choose the privacy level that is appropriate for your own organisation and data.
A point to watch: Microsoft’s known limitations page describes a different behaviour when a web URL is pasted into the file-selection dialog: the file can be downloaded and the source can end up pointing to a local path. This is different from the URL field in the connection form that I used in the video. If you see this behaviour, Microsoft suggests using the Web API connector for the URL. After connecting, check Data source settings to make sure the source is still the cloud URL you intended. See Microsoft’s known limitations and workaround.
A Quick Look at Diagram View #
Check out the video on YouTube at 9:53
This blog is mainly about connecting to the Excel file, but I cannot finish without mentioning one feature I really like in the new experience: Diagram view.
In the older Power Query Editor, we can go to View > Query Dependencies to see how queries depend on each other. It is useful, especially when a solution has several queries and parameters. The new diagram view gives us a more detailed visual way to explore the queries and their steps.

In my example, the SharePoint Site parameter connects to several queries, and each query card shows its steps. When there are merges, appends or other transformations, this view can make it easier to understand how the queries fit together. I find it a nice improvement when working with a larger Power Query solution.
Final Thoughts #
The key is to check the location that Power BI actually reads. A workbook may live in OneDrive for Business or SharePoint Online, but a connection to its synchronised C:\ path is still a local file connection. A direct cloud URL changes how Power BI reaches that Excel source after publishing.
You can get that URL from Copy path in Excel Desktop or from Copy direct link in the file’s details pane. The Web connector works with the direct URL, and in the new Power Query experience I could also use the Excel workbook connector’s URL field. After publishing, check the source mapping, credentials and refresh result in the semantic model settings.
Have you ever come across the gateway prompt for a file you thought was already in the cloud? Let me know in the comments below.
If you found this useful, you can follow me on LinkedIn, subscribe to BI Insight on YouTube, or follow the BI Insight podcast on Spotify. I also share updates on Bluesky and X, covering Power BI, Microsoft Fabric, AI, and the real-world data and analytics problems I come across along the way.
Discover more from BI Insight
Subscribe to get the latest posts sent to your email.