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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Saumil
Frequent Visitor

Change Database dynamically

Hey there.

 

This is saumil here. I am new to the power bi and I do have a question. I hope you guys makes me clear about it.

 

I have a multi-tenant app and have one power bi report. In that report I have a Tenant parameter with the list of values "Tenant1" & "Tenant2". Please refer the screenshot. Now I am using this paramter value to connect to the database as dbname.

 

Saumil_0-1708406067355.png

 

When I publish the report to the power bi service then from there I can able to change the Tenant value and it loads the report accordingly.

 

Wha I wanted to do is, I want to change the database name from my angular or .net core application by passing the value of Tenant Parameter.

 

So, can you guys help me out on this?

3 REPLIES 3
Saumil
Frequent Visitor

@Anonymous thanks for your reply. Now what if i want to set the value of that parameter from my client app which made in .net mvc?

vikramkumawat
Advocate II
Advocate II

Thanks for your reply. I have completed at this level but once I publish that report to power bi server and when I try to pass the parameter value from my angular or .net mvc app then it does not change the database name.

 

So, I want to pass that dynamic parameter from my client app and needs to get the report details as per the login user's database.

 

Thanks

Anonymous
Not applicable

Hi @Saumil ,

Please try below steps:

1. Create a Parameter:
- Open your Power BI Desktop.
- Go to the Home tab and click on Manage Parameters.
- Create a new parameter (e.g., "DatabaseName") and set its value to the initial database name (e.g., "AdventureWorksDW2012").

 

2. Modify Your Data Source:
- Connect to your data source (e.g., SQL Server database) using Power Query.
- In the Power Query Editor, locate the step where you specify the database connection.
- Instead of hard-coding the database name, replace it with the parameter you created (e.g., '#"AdventureWorksDW2012"').

 

3. Change the Data Source Dynamically:
- Now you can go to the query where you want the source to be dynamically changing.
- Click on the relevant source step (e.g., the one specifying the database name).
- Set the database name to come from the parameter you created earlier (e.g., '#"AdventureWorksDW2017BIG"').
- That's it! Your report will now adapt to the new data source without manual intervention.

 

For more details, you could read related document: Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.