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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
SevsBo
Helper V
Helper V

Alter DirectQuery source but keep all existing tables and data?

I have a PBI report that is linked via DirectQuery to a report called "Report 2a". We have recently made some changes to that report, so it made sense to rename it & it data model to "Report 2b". This has caused an issue with the first report since it lost the DQ connection to that report.

 

I know I can use Transform Data --> Data Source Settings to set up a new DirectQuery, but doing so also requires me to select the same tables I already have, which I'm guessing means re-doing all the connections and calculations for that data.

 

So my question is, is there a way to just correct the report name in the DirectQuery so it points to the renamed report, without having to either rename it back or re-do all the work that has already been done?

1 ACCEPTED SOLUTION

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.

View solution in original post

10 REPLIES 10
v-pnaroju-msft
Community Support
Community Support

Hi SevsBo,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

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.

v-pnaroju-msft
Community Support
Community Support

Hi SevsBo,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi SevsBo,

Thank you for your followup.

Based on my understanding, in instances where the source dataset has been renamed, the only supported approach is to remove the broken tables and re-add them manually using the new dataset connection ("Report 2b") via Get Data > Power BI Datasets. However, to avoid recreating all the report visuals and measures, please use the "Manage Relationships" option carefully after re-adding the tables, so as to restore only the dataset bindings without affecting the entire report.

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other members of the community who may encounter similar issues.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @HarishKM, for your response.

Hi SevsBo,

Based on my understanding, DirectQuery connections to Power BI datasets or Analysis Services models do not appear in Power Query (Transform Data). This might be the expected behaviour, as those sources could be managed through the composite model and might not be exposed in the M code or Advanced Editor.

Please follow the method outlined below, which may help resolve the issue:

  1. If your report is published, navigate to your report > Settings > Dataset. Click on "Choose a different dataset" and select the renamed dataset (for example, "Report 2b"). This will retain all visuals, measures, and structure intact.

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

Thank you.

HarishKM
Solution Sage
Solution Sage

@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

 

Hi @HarishKM 
I can open Transform Data but that only shows me the data we added without DQ, which I can edit. All DQ connections are invisible in this view. Is there a way to see them?

v-pnaroju-msft
Community Support
Community Support

Thank you, @rosha_roshafor your response.

 

Hi @SevsBo,

 

We would like to check if the solution provided by @rosha_rosha has resolved your issue. If you have found an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.

If you found the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to similar queries.

 

Thank you.

rosha_rosha
Resolver II
Resolver II

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?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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