Categories: Power BI

Power BI Desktop overwrites Authentication Settings in Similar Connections

Yesterday I was facing an annoying issue. I have two Power BI datasets. Both connect to the same Azure SQL database, but with different SQL users (they have both different permissions on the data in the database). This can be a use case for example where you have data for multiple clients inside one single database.

Let’s say I have dataset A and dataset B, both are two different Power BI Desktop files (.pbix). They connect to the same database, but pbix A uses SQL user alpha and pbix B uses SQL user beta. I enter the connection information in pbix A and refresh the dataset. Everything is fine. I update the connection settings in pbix B and refresh that dataset as well. Again, everything works. However, when I open pbix A again and refresh, it uses SQL user beta instead of alpha. Because the connection string (server – database name) is the same, Power BI Desktop overwrites the settings.

Luckily there’s an easy work around (thanks to @benrebooted and @freder1ck for the suggestion). You simply change the name of the database to uppercase in one connection, and to lowercase in the other connection. Since Power Query is case sensitive (and that’s where the connection is created), Power BI Desktop will treat both connections as separate and will no longer overwrite the database credentials.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

View Comments

  • You are in for a rude awakening. We have a ticket open with Microsoft for a similar issue. They told us that the "connection strings are case sensitive" dogma is actually more of an accident, and that their backend team is performing all kinds of crazy transforms on these strings. There is NO guarantee that your "solution" will work for any length of time.

Recent Posts

Book Review – Microsoft Power BI Performance Best Practices

I was asked to do a review of the book Microsoft Power BI Performance Best…

6 days ago

Create a Numbers Table in Power Query

This is a quick blog post, mainly so I have the code available if I…

1 week ago

Microsoft finally adds Tenant Switcher for Fabric / Power BI

Praise whatever deity you believe in, because it's finally here, a tenant switcher for Microsoft…

2 weeks ago

Book Review – Humanizing Data Strategy by Tiankai Feng

This book was making its rounds on social media, and the concept seems interesting enough…

2 weeks ago

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

I'm hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM UTC.…

4 weeks ago

dataMinds Connect 2024 – Session Materials

The slides and scripts for my session "Tackling the Gaps & Islands Problem with T-SQL…

2 months ago