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.
Hi Sevsbo,
Option 1: Use Power BI Desktop’s Advanced Editor (if applicable)
If your DirectQuery source is a Power BI dataset, and your report uses composite models or a shared dataset, you may be able to reconnect to the renamed dataset via the Model View or Manage Relationships feature:
Steps:
Open your Power BI report.
Go to Model View.
Right-click the broken table > choose Manage Relationships or Replace Data Source (if available).
Reconnect it to the newly named dataset ("Report 2b").
However, this only works if the schema is unchanged and you still have access to the new dataset.
Option 2: Use Tabular Editor to Remap the Dataset (Advanced Option)
If you're working with Power BI datasets via DirectQuery and want to avoid rebuilding everything:
Requirements:
Tabular Editor (free version is fine)
Power BI Desktop
The new dataset must exist in the same workspace and have the same schema (tables, fields)
Steps:
Open your .pbix file in Power BI Desktop.
Open Tabular Editor (External Tools).
In Tabular Editor, locate the Data Source in the left panel.
In Tabular Editor, locate the Data Source in the left panel.
Edit the connection string (or data source reference) to point from "Report 2a" to "Report 2b".
Save changes and close Tabular Editor.
Refresh your Power BI report.
This approach changes the source behind the scenes while keeping your data model, measures, visuals, and transformations intact — as long as the new dataset matches the old one in structure.
Important:
Always back up your .pbix before editing data sources.
These methods require that the renamed report (“Report 2b”) has the same schema as the original.
If table or field names have changed, some manual adjustment will still be necessary.
Let me know if you need help with the exact steps or the Tabular Editor script.
Hi rosha_rosha,
I don't see the option to Replace Data Source, and I don't see anything in Relationships that would allow me to replace the connection. Could you share a screenshot of what I should be looking for?
Regarding Option 2, using Tabular Editor, I unfortunately cannot use that due to corporate policy.
Is there another way?