Excel PowerPivot - change data source type - excel

I have an Excel 2016 with 30 graphs based on PowerPivot. PowerPivot fetches the data from another Excel sheet, but I want it to get the data from a SQL server table instead.
How can I change the data source type in PowerPivot? I've tried looking in the Excel xml without any luck. Would be a lot of work re-creating all graphs over again just to switch data source
Thanks
Dennis

One suggestion I would make for the future, if all the users are using 2016 is to use Power Query which comes standard with that version of excel. In the Power Query loading data into Power Pivot scenario, all Power Pivot cares about is the column names. This means that the query can be changed between data source types without causing issues, as long as the same column names are changed.
As an example, I have one file that based on a parameter flag rips data out of a series of excel files on a shared network drive or Share Point. Both of which would be different data sources. The first opening a folder as the data source, then excel files listed within the folder. The other opening a share point list as its data source, then navigating though excel files.

Related

Connecting Powerquery to multiple Powerpivot files

I have around half a dozen Powerpivot files containing data extracted from an SQL database. Each file has around 30 million lines of data in an identical format. I do not have access to the underlying database but each powerpivot file contains the data.
I would like to connect to all of these files in one new workbook using Powerquery so that I can append them, add them to the data model and work with them in Excel.
I have found various solutions on how to get the data into CSV format using DAX studio but I would prefer to avoid this as it seems an unwieldy solution to export hundreds of millions of lines of data to CSV and then import it back to Powerquery when I already have the formatted data in Powerpivot.
I also don't have any experience of using SQL so would prefer to avoid that route.
I've tried creating a linkback as described here https://www.sqlbi.com/articles/linkback-tables-in-powerpivot-for-excel-2013/ but when I connect to this it only returns 1,048,576 lines of data (i.e. what Excel is limited to).
Is there an option for Powerquery to use Powerpivot data in a separate workbook as a source or another straightforward solution?
Thanks
You can either materialise the data (which you've tried, using Linkback tables), or you can copy the queries. There's no other way to reference powerpivot model data.

CSV Connection into Named Table not Range

If you make a data connection to another Excel file or an Access table it will import that data into excel as a Table. This is great! But when I do the same with "From Text" and choose a CSV, it loads no problem, but it loads as a RANGE not a TABLE. This is highly frustrating as I NEED it to be in the table format so that I can take advantage of the dynamic column names.
Am I missing a tickbox somewhere? I'm not opposed to using VBA but it really seems odd that Excel can't do CSV to Table so I'm hoping for a native solution.
I should mention that if it's a VBA solution, it CANT break the workbook. So if I'm doing something like:
=SUMIFS(CSVDATA[SalesDollars], CSVDATA[RepName], "BOB")
It will still work after refreshing.
So you can get around the 'data connection' not creating a table by downloading the MS Excel 2010 plugin (from Microsoft) called Power Query. It's free and is a default feature in MS Excel 2013.
It will allow you to choose to create a Power Query Table from External Data >> From File >> From CSV
Upon doing this, it will create a named table for you and a Power Query object attached to the table. You can use the table itself the same way you normally would - with the Columns as references for formulas.
For instance, the default table that I just created using the steps above was auto-named: Table_ExternalData_1
I can then select it using the normal method in formulas:
=Table_ExternalData_1[Column2]
etc...
Hope that helps.

Link to pivot table from another excel file

Banging my head against the wall on this one and every option I try has a problem with what i am trying to achieve.
So I have a pivot table in excel that is connected to a database. What I want to be able to do is have a link in another excel sheet to that pivot table, so that it picks up any changes to it in terms of data. The reason I am doing this is because I am putting the excel file up on sharepoint, but if a user downloads it, it retains the connection to the SQL Database, and because they are not authenticated, it doesn't refresh. I need them to be able to do this because it will allow them to customise their pivot table as needed, and it will retain that when they next open it. But the original pivot table, connected to the datasource, won't be affected.
I have tried:
Copying Pivot Table: I have copied the pivot table and pasted it in a new excel file, and this retains the connection to the SQL Database so doesn't work.
Moving Worksheet: I have tried moving the whole worksheet to a new excel file and this does again retains the link to the SQL Database.
Creating connection to excel file: This connected to the excel file, but the pivot table is lost and it simply shows the data in standard excel format.
Slicers: I have looked at slicers but this won't work either, because it means if he makes a change it is reflected in the original pivot table.
Sharepoint: I have looked at excel services on sharepoint. Although I can get him to view the data on the online excel, again, if he downloads it it loses the connection.
I guess I could change the authentication settings on SQLServer so that rather than using windows authentication I create a password and then that password is retained as I copy the file. Because this would only allow access to the view in the SQL Database this would prevent any detrimental activity. However, what I would really like to do is just give a copy of the excel file that connects to the original pivot table (so that when this updates this data is reflected in the copy on refresh), but any changes in the copy (i.e. formatting etc) only affect the copy.
If anyone knows how to do this I would be most appreciative of your help.
I may said something incorrect here, so pardon my lack of knowledge, but with the option:
Creating connection to excel file: This connected to the excel file, but the pivot table is lost and it simply shows the data in
standard excel format.
If I understand correctly, Creating connection to excel file provides a copy of the database in an excel file with all the source data from the original pivottable, and if by "connected to the excel file" you mean that any changes to the original pivottable is updated in this connected file in the copy of the database.
Then adding a replica of the pivottable in this connected excel file pointing to the copy of the data would not solve the problem?
Am I missing something?

Import additional excel data into Access Table

We need to upload a small amount of additional records to a table from an Excel sheet. Is there a way to use the Access Import function to add the additional data to the table (truncate it). The table was created by uploading the same Excel sheet. But now, when records are added, we need to add them to the table. The tables are linked to SQL but I do not want to use an SSIS because there are only a few records and there must be a way to use Access functions. Suggestions please.
It may be easiest to link the excel sheet and run an append query to add data from Excel to existing table. Once linked, this can be done in the query design window.
You did not specify versions of Excel or Access.
I did this with a test 2003 Excel sheet with cells containing 1000+ characters. An import in Access 2003 detects the data type as a memo field, which is correct, when there are that many characters, so it should work for you. It may be your Excel data has other ingredients causing an import issue. How is the excel data derived?
Have you tried importing to Access? It should work fine. If your ultimate target is another database why use Access as an intermediary?
I agree a linked table seems like a really simple method to update a table if you are using Access, but that is your choice.

MS Excel - Pivot Table - Accessing the source data when it isn't a tab in the spreadsheet

I have a spreadsheet that is emailed to me by an outside vender. It contains a bunch of pivot tables. I really couldn't care less about the pivot tables, I just want the underlying data. The data comes from a sql server that I don't have access to, but the data is stored within the spreadsheet. Is there anyway that I can access the data, (I think it's the PivotCache) directly without drilling into one of the pivot tables?
I'd love some sort of ODBC/ADO.Net command that I can use from SSIS. But am open to just about anything that doens't require me to open and save the workbook.
I'd also like to avoid macros if at all possible.
Here's the answer. Or at least what I did to resolve my problem.
There is really no way to accss the underlying PivotCache data except via pivot tables. So direct accss was out. I ended up using a script task with excel ole to dynamically create a pivot table with the data I needed at run time. Once the script task is done, I then use the new pivot table as my dataflow source. Excel can be a little tricky to automate, but it's worth it.

Resources