Cannot delete "ghost" table from Power Pivot - excel

I have created many power queries and power pivot tables in my Excel file. After some time, I think the data structure may have gotten corrupted, because this is happening:
In Data Model, I have this Community_Membership table that cannot be deleted. It is the only table that has this behavior (all other tables were deleted successfully)
After that, I went to Power Query to delete all existing queries AND CONNECTIONS, so that the list is empty like below.
But this table remains un-deletable there after I have deleted all queries from queries list.
Anybody know how to fix this?

I finally recreated the file as follows:
Make a new Excel file
Copy all of the sheets
Select all of the queries from the old file's query pane, hit copy
Go to the new file's queries pane, hit paste
Go into Query Editor and edit any names with conflicts or remove any redundant queries
The entire process takes about 10 minutes as I only had about 10 queries / sheets.
I suspect this happened because I created a query, added it to the data model then went back to Power Query and edit it (either its name or its content in some mysterious way). After that the link between PQ and PP is broken so that even after the original query is deleted, its clone in PP remains. Strange.

I encountered a similar situation after having renamed a query in Power Query : Power Pivot could see the new table under the new name, but the old table was still there in Power Pivot and could not be deleted.
Finally I came up with this solution :
Make sure there are no remaining relationships or measures in Power Pivot that refer to the table you want to delete.
Create a query in Power Query, having the same name as the table you want to delete. The content of the query does not matter. Make sure that the checkbox "load into the datamodel" is checked. As a result, the synchronization between Power Pivot and Power Query is restored.
Edit the query again and uncheck the checkbox. Now Power Pivot understands that we want to remove that table.
Now you can delete the query in Power Query.

Related

Refresh power pivot-power query

I have a table in power query that is fed from some Excel files, with this data I make an inner join with other catalog tables that I have and do operations on calculated columns and then add to the power pivot data model to make some pivot tables, initially everything was working very well until I made adjustments to the power query table by removing or adding more columns as well as editing the inner join operations, now when I do an update with and I want to pass the power query table to data model power pivot it gives me an error that the table does not exist, Mention that if I do the update only power query table it works without problems, the problem is when the data is going to be passed to power pivot.
How can I correct this error?
Sorry for my English
Yes, often when changes are made to initial queries these issues happen. Normally, when Query Names and/or Field/Column Names are changed and these names are used in the Merge or calculation steps query will pop these errors.
So, review/compare all the changes that you made to steps after the merge.
If you don't find any errors, consider making a copy of the steps and rebuilt from the merge to ensure optimum performance.

Excel Table Rows Moving on Power Query Refresh

I have a Power Query connection that's pulling data from a CSV file into an Excel table. I have then added columns to that table in Excel and added some data to those columns manually.
The issue I have is that whenever I refresh the Power Query, the 'manual' data rows don't stay lined up with the Power Query rows. Specifically, it seems that the manual data all gets shunted down a row in relation to the Power Query data, although even that isn't completely consistent.
I tried unselecting the 'Preserve column sort/filter layout' option in External Data Properties, but that went horribly wrong, as it just removes all of the manually added data from the table completely.
The Power Query itself is very simple, it just takes the CSV data, promotes the headers, changes a couple of types and removes a few columns - there's not even any data filtering going on.
Any assistance much appreciated!

Delete Power Query steps after loading to Power Pivot data model

I need to delete query steps after loading the data into model. The reason is to hide the sources, protect our know-how, or maybe I'm just not very proud of what I've done ;).
But when I delete PQ connections or change "Load To" option, also the tables disappear from data model and pivot table becomes unresponsive. It's also not possible to modify or delete the connection created in Power Query from Power Pivot window, or even view table properties.
I could use Review > Protect Workbook > Protect Structure to disable viewing and editing queries / connections, but the steps are still visible, and the user cannot modify the workbook; even pivot table drill-through function doesn't work as it needs to create a new sheet to show data rows.
If you need to remove the query steps, then you have to store the data within the Excel file (since a query is just a set of instructions for how to connect to the data and transform it).
What you can do is create a query, load it to a table in an Excel sheet and then delete the query, leaving a static table. You can then create a pivot table using this static table as the source and it should function normally (though you obviously won't be able to refresh the data). I.e. don't create a data model until you've loaded your data and removed the query.

Excel - Power Query - how to create a new query based on the existing one

I have created a number of power queries. So far I have done them by merging two sources (Merge as new). Now just want to extract from the existing query. I don't need to merge it with another one. I'd like to do some filtering on the query and save it as a new one. When I click on the query and edit (filter) it, it'd update the existing one. I'd like to save the results of my filtering as a new query.
I'm using Excel 2016 (O365). Thanks
Find your "existing query" in the Queries & Connections pane. Right-click it and choose Reference.
You can also do this in the Power Query Editor window, from the Queries pane.
You will get a new query which picks up from the last step in the "existing query".

Excel 2010: Replace a table by an external connection without impacting other sheets

I have a big workbook with a lot of data. In one sheet I have a table. This table is used for many Pivot tables used in other sheets, which are also used in other sheets.
The data for the table was copied manually regularly. I now have a external connection to import automatically the data but I'd like to avoid impacting other sheets.
How can I use my external connection without losing my table?
Thank you for your help
This might be a helpful workaround. I have successfully done this but it may require a bit of rework and not be the exact answer you expect. (I am using Excel 2010).
The reason for a workaround is I assume this is for a regular table (not a pivot table) as the source table. Unfortunately, I don't believe the switching connection options work for regular tables in Excel 2010.
Recreate a new table just below the other in the same worksheet by going to the Data tab > Get External Data > Existing Connections
Select your data connection (assuming it has been created) then select how you want to view the data. ie: Table
Place in your existing worksheet. Use your old table as a reference to reconnect all the connections to your other sheets, then delete the old table.
At this point, I find it easier to rebuild/copy those existing links to the new table with external data.
The good news: If your source table is a pivot table or pivot chart with an existing connection, you can easily change the table to have an external data connection (and switch between data connections).
For a pivot table with an existing connection you wish to change, select a cell in the table. In the ribbon above in 'PivotTable Tools' > Options tab > Change Data Source, you will be able to select this and reconnect to another source under 'Choose connection'.
For a pivot table with static data to introduce a new connection, I would suggest a similar workaround above.
I hope this works for you.
I'm going through this too. I've done some testing, and this is the approach I am going to take.
Save copy of file (just in case!)
Create a new sheet, and create link to your database, and have it entered as a table on this new sheet
Make sure your old table (manually entered) matches the same layout as the table with the data you are connecting to (same column order and column names)
For each pivot table, change the source to the new table (it should keep all of your setup the same if the columns are labeled the same)
Do a find and replace to change all formula referencing to the new table name.
Change any code in VBA that references the old tables
This should result in the least issues while making the changes. Just don't forget the first step!
If both connections/query are SQL or PostgreSQL, you can simply copy the query code from the new query to the old query. Then you do not even have to replace anything. "Edit" - "Advanced editor"

Resources