Forum Discussion
Interesting bug: renamed a table using Edit Query, made a few minor tweaks, and it went "missing"
- 1 month ago
Hi,
From your description, this appears to be related to how Power Query tracks query metadata during the Apply Changes process.
When you rename a query and make additional transformations in the same editing session, Power BI can occasionally retain a reference to the original query name in its dependency graph or pending changes. As a result, Apply Changes may still attempt to load the old table name, even though the preview displays the renamed query correctly.
A few things you can try:
Rename the query first, apply the changes, and then make any additional transformations (as you've already found works reliably).
Check whether any other queries, parameters, or disabled-load queries still reference the original table name.
Open View → Query Dependencies in Power Query to verify there are no lingering references to the old query.
If you're using incremental refresh, calculated tables, or relationships, confirm they aren't still pointing to the original query name.
Since the preview works correctly but Apply Changes fails, this may be a product bug rather than an issue with your query logic.
If you can reproduce it consistently with a simple example, I'd recommend reporting it through the Fabric/Power BI Issues forum or opening a Microsoft Support ticket. A reproducible sample will help determine whether this is a regression in the current Desktop release.
Has anyone else experienced the same behavior when renaming a query and making additional edits before applying the changes?
If you found this reply helpful, please consider giving it a Kudos. If it helps resolve your issue, marking it as the Accepted Solution will help others encountering the same behavior.
Hi SevsBo
Based on your description, this looks less like a report visual issue and more like a metadata / apply-order issue inside Power BI Desktop.
If the query preview loads correctly, but during **Close & Apply** Power BI still tries to load the previous table name, then the M query itself is probably valid. The problem may be that the semantic model metadata is still being refreshed against the pre-rename table name while other query changes are being committed in the same operation.
I would check a few things first:
1. Open **Power Query > Advanced Editor** for the renamed queries and search for the old table name.
2. Use **Query Dependencies** / related queries view to confirm that no other query still references the old query name.
3. Check whether any other calendar query was created by **Reference** rather than **Duplicate**, because referenced queries can still depend on the original query.
4. Also check calculated tables, relationships, measures, and hidden tables in the model, just in case something in the semantic model still points to the old table.
If nothing references the old name, then your workaround is probably the safest approach:
* First rename the query/table only.
* Close & Apply.
* Save the PBIX.
* Reopen Power Query.
* Then apply the date range / transformation changes.
For template files, I would also suggest keeping query/table names stable where possible and controlling calendar ranges through parameters, or using a reusable calendar function and then creating separate final queries from it. That reduces the chance of Power BI needing to process a table rename and query-structure changes in the same metadata transaction.
If this can be reproduced in a clean PBIX with only those calendar tables, I would treat it as a Power BI Desktop bug or limitation and report it. A small sample PBIX would also help others test whether it is version-specific.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- SevsBo1 month agoResponsive Resident
Thank you for the detailed reply.
I have just had the same thing happen, and have followed your instructions. For the record, the original name of the tables was Template_.... which I then renamed to Content_....When the load failed again, I tried right clicking on the now misnamed tables and got a new, though not expected, error:
By this point the Template_ naming had been renamed to Content_... but the irony is I cannot refresh the data model because the same error occurs that started this question.
To answer your points:
1. No such references, as I either duplicate the original UC (ultimate calendar) query, or copy-paste the M Query from the Advanced Editor
2. No query dependencied found for UC tables, which are causing the issue:
3. No, all duplicated from original table. Guessing the problem is I dupliated before renaming, then renamed the duplicate as well.
4. No measures, reationships, or hidden tables. All tables are stand-alone, as this is a template file on which new reports are built. A Template_Measures table exists, but that has a placeholder measure in that literally says "1".
As last time, I cannot action anything, so all I can do is revert changes and start from scratch, first renaming the tables, loading that, and then duplicating.