Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
SuryaRS
New Member

Dynamic Datasource Changein Direct Query

Hi All,

I have a requirement of changing the database dynamically based on the logged in user.

Requirement is described below:-
I have 5 Azure Databases DB1,DB2,DB3,DB4 and DB5. The schema is same in all the databases but the data is different. I have another database and that database is having the configuration table as below:-

emailDatabaseName
User1DB1
User2DB2
User3DB3
User4DB4
User5DB5

The requirement is to change the database dynamically in PowerBI based on the logged in user.
Here user is accessing the powerbi report from the dotnet application.The requirement is if a user is clicking on the powerbi report from the application, the report should fetch data only from the corresponding database.For ex:if user1 is accessing the report then he should be able to see the data from DB1 only. Is there any way to implement this dynamic datasource change in Direct Query without passing Database name from the frontend as a parameter ?

2 REPLIES 2
amitchandak
Super User
Super User

@SuryaRS , You can change it dynamically, but I doubt you can control it using URL

https://radacad.com/change-the-source-of-power-bi-datasets-dynamically-using-power-query-parameters

 

As you using .net application, you can change report url, pointing to these dbs

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit @amitchandak 
Is there any way to dynamically change the datasource without passing databasename as the parameter in Direct Query?

Thanks 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.