Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
We have two machines that run Report Server on them: one for production and one for development where the development server is a clone of the production server plus any development we are doing. Both machines also have SQL servers running on them with identical sets of data. Currently, all reports point to the production SQL server for data. However, as the number of reports has grown, we are starting to see report refresh slowdowns and reports getting stuck because the reports on both machines are refreshing at the same time using the same machine. We have manually shifted the refresh times on the development server to later to avoid this. However, a more satisfying solution would be that all the reports on the development server using the SQL server on the development server and not the production server. Does anyone know of any easy (e.g. SQL, Power Query, etc.) way of changing the data source of many reports as a batch process to accomplish this?
- - - Andrew
Solved! Go to Solution.
Hi @NHCC_IRE ,
Bsed on my knowledge, it is not supported to change the data source directly without open the .pbix file. Please try to create query parameter like what @d_gosbell mentioned.
Or, maybe you can also try to store your connection string to a config file, then write a custom function to analysis this file. After these steps, you can change the datasource without open the pbix file.(After you modified the config file, you should refresh it at pbix report to get the newest data).
Sample:
let xmlTable = Xml.Tables(File.Contents("C:\Users\xxxxx\Desktop\test.xml")), server=xmlTable[Server]{0}, database=xmlTable[Database]{0}, Source= Sql.Database(server,database) in Source
Xml:
<config> <Server>"abc"</Server> <Database>"edd"</Database> </config>
Screenshots:
Reference: Solved: Re: Change pbix data source programmatically - Microsoft Power BI Community
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NHCC_IRE ,
Bsed on my knowledge, it is not supported to change the data source directly without open the .pbix file. Please try to create query parameter like what @d_gosbell mentioned.
Or, maybe you can also try to store your connection string to a config file, then write a custom function to analysis this file. After these steps, you can change the datasource without open the pbix file.(After you modified the config file, you should refresh it at pbix report to get the newest data).
Sample:
let xmlTable = Xml.Tables(File.Contents("C:\Users\xxxxx\Desktop\test.xml")), server=xmlTable[Server]{0}, database=xmlTable[Database]{0}, Source= Sql.Database(server,database) in Source
Xml:
<config> <Server>"abc"</Server> <Database>"edd"</Database> </config>
Screenshots:
Reference: Solved: Re: Change pbix data source programmatically - Microsoft Power BI Community
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could try this technique using Parameters in your Power Query code then changing them with a PowerShell script https://docs.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
7 | |
5 | |
3 | |
3 |