SOLVED

can't delete "connection only" query from Power Pivot

Brass Contributor

In Excel for Microsoft 365, I initially added a query to my data model.  Then I changed it to load as "connection only".  But it's still in Power Pivot, which doesn't let me delete it.  How do I delete it from my data model?  Thanks.

7 Replies

@rootsmusic When you chose "Connection only", did you also uncheck the box "Add this data to the data model"?

Yes @Riny_van_Eekelen, the query says "connection only" in the "Queries & Connections" pane. But it's still in Power Pivot.

@rootsmusic That's odd. I've tried several scenario's. Adding tables to the DM via PQ, creating relationships and pivot tables from them. Now, you can't delete the tables directly in the DM. It comes up with a message that "the tables was created by a query. Adjust the query". So, I right-click on the query in Queries & Connections list, Load to... and uncheck the DM box. A warning is displayed indicating that there will might be a loss of data, but I can choose to delete and the table is removed from the DM.

@rootsmusic 

 

are you sure you did not add the data using the clipboard?

Yes @Riny_van_Eekelen, that's what I did. I think the reason the query wasn't deleted was because it had an active relationship in Power Pivot. Nonetheless, Power QUERY unloaded it in the "Query & Connections" list and thereby dissociated the query from the data model's data table.

After the query was supposedly made "connection only", I tried to add it back into the data model (thinking that doing so would reload its dissociated data table). Then I repeated your steps, but the query still won't delete.

P.S. yes @Yea_So, I didn't know copy-and-paste is a feature for queries.

@rootsmusic 

 

To clarify,

are you trying to delete a query from the query navigator?

or 

are you trying to delete a queried data set from the data model?

best response confirmed by rootsmusic (Brass Contributor)
Solution

@Yea_SoI was trying to delete the query from the data model (Power Pivot), but keep it as "connection only" in Power Query. I finally did so by renaming the "connection only" query and disconnecting its relationships. (So it seems to be a bug in Power Pivot when trying to delete a query that has active relationships.)

1 best response

Accepted Solutions
best response confirmed by rootsmusic (Brass Contributor)
Solution

@Yea_SoI was trying to delete the query from the data model (Power Pivot), but keep it as "connection only" in Power Query. I finally did so by renaming the "connection only" query and disconnecting its relationships. (So it seems to be a bug in Power Pivot when trying to delete a query that has active relationships.)

View solution in original post