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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
davidstump
New Member

Unable to delete or rename Direct Queries due to new error

Yesterday (8/26) afternoon I began to get an error whenever I try to delete or rename a Direct Query in my PBIX file. The error is (I edited out the name of my query) :

Failed to save modifications to the server. Error returned: 'DirectQuery partition has '0' datasource reference(s) in its expression which is not allowed.
 '.

Interestingly, if I rename a Direct Query from "Query1" to "Query2", the error references "Query1" in the message. It is almost like Power BI is no longer able to cleanly modify my Direct Queries. I can rename Import queries in the same file with no issues.

 

Rebooting my PC and clearing the cache in the Global options did not fix the issue.

 

I actually rebuilt my PBIX file completely by copying out all of my power query code, DAX tables, visualizations, etc into a new PBIX file. This also did not fix the issue.

 

The direct queries are referencing a standard SQL server.

 

Can someone please help me figure out what is going on here?

7 REPLIES 7
Dyeison
New Member

I am using the May 2021 version and have the same problem.
Is there no solution?

pranit828
Community Champion
Community Champion

Hi @davidstump 

This should not be an issue.

I will follow these steps in your case.

1. Refresh to see if it refreshes fully, if not something chaged at your database end

2. update my PBI and try step 1 again.

3. Reply back with .pbix file if  stwp 1 and 2 dosn't work.

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@pranit828 @davidstump  I've started getting the same error just recently too - end of Aug 2020. 
I have a pbix file I've been using for years, and while I haven't touched it in a few weeks, when I opened it up to make a small tweak the other day I started hitting the same thing.

 

I can download a fresh version of the pbix file from the service OR use one of my backup files (from months ago): 

  Right after opening the file if I click Refresh (all queries), everything works and everything refreshes ok.
  When I add/delete anything in the model from the Query Editor (eg: open Query Editor and deselect "Enable Load" on a single query) then when I Close & Apply the changes I get this error. 

 

 A couple other things I've noticed.

  I CAN delete a query from the "Fields view" in the main UI, but when I delete (or disable) from the Query Editor view that's when I run into problems.

  I CAN edit an existing query text in Query Editor (eg: Advanced Edit) and save/apply and it works. 

  I CAN add a new query (in Query Editor) and it works.  

  Deleting or "disabling load" in the Query Editor is when I get the problem. 

  I've also noticed somethign else odd, in the Query Editor view the data preview's never seem to load, they always just spin and spin, this is new it used to work.  A couple times in all my testing for this new issue they started working, but I'm not quite sure what I did or didn't do.  But today at least when I open the pbix, I can refresh-all and it works, but as soon as I open the query editor the previews don't ever complete.  (and I never see it going to SQL when I use SQL profiler on the datasource either, even if I clear the caches).

 

Here's the Full Error Text:  (the GUID varies on each repro) 

  Failed to save modifications to the server. Error returned: 'DirectQuery partition 'Query1-2a1eca3a-8888-4d82-af93-58e078e4c345' has '0' datasource reference(s) in its expression which is not allowed. '.

 

  My data source is a SQL server, I have a single data source for all the queries in the file, I do mix and match sql queries (= Sql.Database ... advanced queries) and (= Source{[Schema="dbo",Item="TABLENAME"]}[Data])  basic select * type results) 

  I've tried 2 different versions of the PBI Desktop tool on different machines.

  Version: 2.85.284.0 64-bit (September 2020)  and Version: 2.84.981.0 64-bit (August 2020)  (is there a way to download older versions from somewhere to test on?) 

  I've tried to open several month old backup copy of my pbix file and it still happens. 

 

  My model has like 60 queries in it, I haven't had the heart to try and duplicate it 100% yet, but I have tried to delete essentially all my queries to see if there was one "corrupt" one, but that didn't seem to help.

  Also I can't seem to reproduce it with a few basic tests (like copy'ing a couple of the queries) to a new pbix file. 

 

My working theory is somehow the Query Editor is corrupting the file when it's used to delete/disable a query. 

 

 

@pranit828 @davidstump 

This was a product bug, it's been fixed in the latest version 2.85.442.0 64-bit (September, 2020) of the desktop client. 

 

Thanks! 

 

fam
Frequent Visitor

Hi! I'm having the same issue.

Where do I download the latest version?

I tried to download PowerBI Desktop (which usually works to update to the latest release) but I still have the August 2020 release.

 

Thanks a lot!

@fam My desktop install just automatically updated to the newer version.  

But you are right I just checked the explicit download page and it still has the Aug version listed.   

I assume it'll be updated/get out to everyone shortly, hold tight! 

 

In the mean time if you need to delete a query, what I figured out was you could delete a query from the "main ui" directly in the Fields list, do not delete them in the "child" Query Editor UI.   That was my workaround at least.  

lg77
Frequent Visitor

@lamard  Thanks for your info on this thread, it's been helpful to know that there was/is a known bug causing this. I am running the lastest: Version: 2.86.727.0 64-bit (October 2020), and I am hitting this same wall. Could you possibly share a URL to where this bug is reported so we can follow its progress?

 

Thanks for your time!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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