Forum Discussion
Alter DirectQuery source but keep all existing tables and data?
- 1 year ago
No real solution found. I think what I am trying to do simply isn't possible in PBI, but I have raised a suggenstion for product development to enable this.
SevsBo Hey,
Try to replicate as per below
method 1:
Update the Data Source Connection via Advanced Editor
If you're familiar with the M code used in Power Query, you can manually update the connection string in the Advanced Editor without losing your existing transformations. Here’s how you can try this:
Go to Power Query Editor:
In your Power BI report, go to Transform Data to open the Power Query Editor.
Open the Advanced Editor:
In the Power Query Editor window, click on Home > Advanced Editor.
Find the DirectQuery Connection:
Look for the part of the code that defines the DirectQuery connection. It will look something like this:
M Copy Edit
Source = Sql.Database("old_server", "Report 2a", [Query="SELECT * FROM Table1"]),
Update the Report Name:
Change the report name from "Report 2a" to "Report 2b" (or whatever the new name is) in the connection string.
Ensure the connection to the correct data model is being used by updating the report name and server details if necessary.
Apply Changes:
After updating the connection string, click Done, then Close & Apply to refresh the data.
Thanks
Harish M
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query