Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I am using an Excel Superstore dataset located on my PC drive. I have published it and installed an on-premises gateway on my machine. However, when I try to add a gateway and put all the required details then it shows me below error.
However, in Windows username, I put the username that I found from cmd by typing - whoami
Windows password: I enter my four-digit laptop pin that I use every day for logging.
Please advise.
@amitchandak @danextian @lbendlin @IdrissshatilaSolved! Go to Solution.
Hi @aAmirkHan ,
Thank you for your response!!
As it is already mentioned that Your Excel file is stored in a OneDrive-managed folder, even though it's on your C: drive. This can create permission and access issues for the On-premises Data Gateway, especially when it's trying to impersonate your Windows user.
You can try following steps:
1.Create a simple folder outside of OneDrive, such as: C:\PowerBIData\
Then move your Excel file to: C:\PowerBIData\sample-superstore.xlsx
2. Update the File Path in Your Power BI Desktop Report
Open your .pbix file in Power BI Desktop.
Go to Transform Data > Data Source Settings.
Change the file path to the new one (C:\PowerBIData\...).
3. Ensure Gateway Service Runs Under Your Windows User
Open the On-premises Data Gateway configuration tool.
Go to Service Settings.
Change the service account to run under your Windows user: aamir-pc\moham
and enter your actual Windows account password (Not your 4-digit PIN - the full user password).
If you don’t know it, you may need to reset it via Windows Account Settings > Sign-in options.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Hi @aAmirkHan ,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.
Hi @aAmirkHan ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @aAmirkHan ,
Thank you for your response!!
As it is already mentioned that Your Excel file is stored in a OneDrive-managed folder, even though it's on your C: drive. This can create permission and access issues for the On-premises Data Gateway, especially when it's trying to impersonate your Windows user.
You can try following steps:
1.Create a simple folder outside of OneDrive, such as: C:\PowerBIData\
Then move your Excel file to: C:\PowerBIData\sample-superstore.xlsx
2. Update the File Path in Your Power BI Desktop Report
Open your .pbix file in Power BI Desktop.
Go to Transform Data > Data Source Settings.
Change the file path to the new one (C:\PowerBIData\...).
3. Ensure Gateway Service Runs Under Your Windows User
Open the On-premises Data Gateway configuration tool.
Go to Service Settings.
Change the service account to run under your Windows user: aamir-pc\moham
and enter your actual Windows account password (Not your 4-digit PIN - the full user password).
If you don’t know it, you may need to reset it via Windows Account Settings > Sign-in options.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Hi @aAmirkHan ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @v-venuppu ,
I could not find any solution to my question. However, I still want to understand about the file path. I have only C drive in my machine, there is no other drive that I have created like a D or E drive, etc. My file location is on C drive. Please suggest. Below is the file location for your reference.
c:\users\moham\onedrive\documents\practice\power bi\rakesh nag ji\sample - superstore.xlsx.)
Thanks
Aamir
Hi @aAmirkHan
If you are still wanting to use your PC to host the file, make sure that you put the file in a file location that the power BI Gazteway account has got access to. It might also be a permission issue where the file is currently located.
Hi @GilbertQ ,
Thank you for your response, however, I still want to understand about the file path. I have only C drive in my machine, there is no other drive that I have created like a D or E drive, etc. My file location is on C drive. Please suggest. Below is the file location for your reference.
c:\users\moham\onedrive\documents\practice\power bi\rakesh nag ji\sample - superstore.xlsx.)
Hi @GilbertQ ,
I have tried it once again, where I am trying to create connection between SQL Server. However this time it shows me this error.
Hi @aAmirkHan ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @lbendlin @GilbertQ for the prompt response.
“The on-premises data gateway’s service account failed to impersonate the user.”
Indicates that the gateway is running under a service account (e.g., NT SERVICE\PBIEgwService) that does not have permissions to act as your Windows user (aamir-pc\moham) to access:
Local files (like Excel on C:\)
SQL Server using Windows Authentication
Here are some Troubleshooting steps to solve the issue:
Change Gateway to Run Under a Domain or Local Admin Account
1.Open the On-premises Data Gateway app on your PC.
2.Go to Service Settings.
3.Change the service account to:
4.Restart the gateway service.
Make sure this account has:
Switch to Basic Authentication for SQL Server
If you can, enable SQL Authentication on your SQL Server and use that instead:
This avoids impersonation and works better with the gateway.
Move Excel File Out of OneDrive Folder
Your Excel file is in:
c:\users\moham\onedrive\documents\...
That’s a OneDrive-managed folder, which can interfere with gateway access.
Move it to a standard local folder like:
C:\DataSources\sample-superstore.xlsx
Then grant read access to the gateway service account.
If you're not able to configure impersonation or authentication easily:
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Do not use your local file storage. You will not want the Power BI Service to reach down into your PC.
Put that Excel file on a SharePoint or OneDrive. That removes the need for a gateway.
Hi @lbendlin ,
Thank you for your response. I do not want to move my Excel file to OneDrive or a SharePoint folder. However, I want to use the connection between my Power BI Service and Excel.
Please advise.
I do not want you to suffer the consequences of that approach. Do not use local file storage, ever.
I hope someone else can help you further.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 13 | |
| 12 | |
| 10 | |
| 10 |