How to reconnect data source of Excel pivot table slicers - excel

I have a table in my excel workbook which comes directly from SQL Server. From this table I have added a pivot with slicers etc.
I have recently added three new columns to the original data table, not in SQL, but manually in Excel. The new columns contain formulas which updates as I refresh the data from the SQL data source.
I would like to add slicers to my already existing sheet with slicers containing the data from the new columns but for some reason, when I select the data from which to create the slicers, the new columns that I have added does not appear in the list of columns that I can select. If I add the slicers directly from the data table, it is not linked with the rest of my slicers from the same data table.
Should I re-connect the data source to the slicers? If so, how do I completely remove the connection and reconnect again. I have graphs (slicers) and a lot more so I don't want to have to re-do all the work.
Can the problem be that I have added three new columns manually?
Please help! :)

Related

How to clear data from Excel pivot table while keeping connection

My Excel pivot table connects to external data source (OLAP cube) via windows authentication. I would like to make changes to my pivot table and share/publish the workbook. Since there is row security on the dataset, I would like to keep the table "empty", until connection is refreshed with user's credentials.
Is there a way to save the workbook with no data preloaded to the pivot table from the OLAP cube, while keeping the connection string and preserving all the settings and filters of the pivot table?
You can do this by setting your table as an Excel formatted table and set the name of that table to tblData. Then, create the chart but make sure the Chart Data Range is just =tblData. Now you can clear all the data out of the formatted data and the chart will remain in tact.

Add existing Pivot tables to data model

In Excel 2013, I have one table "Table1" in worksheet "Data" and I have a dozen pivot tables in another worksheet named "PivotTable". When I created the pivot tables I was unaware of the checkbox "Add this data to the data model". Is there a way to add all my existing pivot tables to the data model after-the-fact?
If you go to the existing pivot table, below the list of fields you have available, there should be a line that says More Tables.... Click on that and it'll remake your pivot table in a new tab with that data model option checked. You do lose your number formatting, but it sure beats remaking the whole stupid thing!

Dynamic charts from pivot

I have a data set that I am using as an input to a pivot table. I have transformed that data set into a table, so that every-time I add something to the data set, the pivot gets updated automatically. I have also added a line of code, so that every-time a user clicks on the sheet containing the pivot table, the table gets refreshed automatically. Now I need to have a chart (linked to the pivot table) that updates automatically every-time the pivot refreshes (like rows or columns also increase/decrease).
You could use a dynamic named range in order to get the chart data to update automatically. Without knowing what your data looks like, I'll just provide you with a generic version assuming your data is in A1:C5.
=OFFSET(A1;0;0;COUNT(A:A);3)
This will create a range that is 3 columns wide and goes until the last row with data in column A.

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"

How to add data to an existing power pivot table?

I'm looking for a way to load more recent data as date x in Power Pivot and link/add them to an existing table.
Background:
The user downloads data from a datafeed and saves them in Excel Power Pivot.
The data will be deleted from the server afterwards.
In the next step, new data must be added to the existing table in Power Pivot,
so that the workbook graphics can access the complete dataset.
I know there is no API for VBA access to Power Pivot. Is there a
workaround with linked tables and direct access to the database?
1) you create one table just containing the dates from earliest to far into the future
2) you import every new set of data into a new power pivot table
3) you link the dates for a record in the newly imported table to the dates in the power pivot table containing the dates
so the backbone of your whole data is the dates table, while your tables keeping the actual data are treated as lookup tables.
this is hacky and I didn't try it, but it should work

Resources