Forum Discussion
Error while refreshing the pbix file
- 1 year ago
Hi powerbiexpert22 , Thank you for reaching out to the Microsoft Community Forum.
Power BI Desktop retains internal metadata and credential references from the original SQL Server connection even if you've replaced the M code. Changing the source in the Advanced Editor only updates the logic inside that specific query. It doesn’t remove Power BI's stored reference to the original SQL Server connector, which lives in the model and credential store. If any query, parameter or even a disabled step still contains a call to Sql.Database, Power BI will continue treating SQL Server as part of your model. This is why you're seeing credential prompts for a server you're no longer intentionally using.
To fix this fully, open every query, including any parameters, helper queries or functions and search for Sql.Database. If you find any, remove or replace them with the correct Snowflake call, typically using Snowflake.Databases(...) or Odbc.DataSource(...) depending on how you’re connecting. Then go to File -> Options and settings -> Data source settings, find the SQL Server reference, and clear its permissions. That breaks Power BI’s link to the old source and stops the prompt.
Manage data source settings and permissions (Power Query) - Microsoft Support
How to Change the Data Source in Power BI Service - Microsoft Fabric Community
Data sources in Power BI Desktop - Power BI | Microsoft Learn
If this helped solve the issue, please consider marking it “Accept as Solution” so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi powerbiexpert22,
try to use this connector instead:
After this is working you can use the connection string and change yous with the new one in the advanced connection settings.
KR
Clemens