How to clear data from Excel pivot table while keeping connection - excel

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.

Related

How to reconnect data source of Excel pivot table slicers

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! :)

Cannot find the connection created in power query in pivot table connection

I created a connection appending two tables from power query. Now, I want to update my existing pivot table with the connection. But, I cannot find the option in the "Change data source". But, if I check it in the connections options in the data tab, then, I can see the connection I created. Please help!!!
If the Pivot table is based on the Data Model, then the "Change Data Source" button will be greyed out, because the data source for the Pivot table is the Data Model.
If you have appended two queries, it may well be that all you need to do is refresh the pivot table.
In the following scenario, the first screenshot shows the pivot table when only the table on the left has been loaded to the data model.
In the next picture, the table on the right has been added as a query and saved as a connection. Then the table has been appended with the existing "myQuery". Then the Pivot table has been refreshed and the numbers show that it includes the new data values.
If you want to change the data source for the pivot table when it is sourced from the Data Model, you need to work in the PivotTable Fields panel and select the table or query that you want to use. In the screenshot below, you can see that the pivot table uses fields from myQuery, but I could also select fields from Table1 and Table2, which are the original tables in the grid.

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.

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