Is there a way to export Power Pivot Data Model to Power Query? - excel

I have a power pivot data model of around 20000 rows only and wish to take that data over power query window for further modification. What i'm doing right now is , go to Power Pivot Manage Data Model window and then Copy the data, paste it as normal CSV format and run over power query there. I'm looking forward to an easy way to link between power pivot model and power query, so I could just Refresh All and thereby both models will update without any manual copy/paste work. I have checked all through Google and various websites however all I could find was either copy and paste the data (that I'm doing right now) or a vba (however I couldn't figure out how that works, but it does ideally is a copy paste only to normal spread sheet. Please advice.

Related

How to get bitcoin price using power query?

I had this question if you can get bitcoin price history right into excel with power query. The price history is shown in Yahoo finance at the address https://finance.yahoo.com/quote/BTC-USD/history?p=BTC-USD. A lot of people use VBA to get data into excel but I don't like using it. Power query more simple.
This is can be done in power query as long as the site has data in a format that is like a table.
FYI you can bring in other formats too like JSON data.
In excel go to Data> Get & Transform Data and use the drop down.
in the next window paste in the website. https://finance.yahoo.com/quote/BTC-USD/history?p=BTC-USD
Some websites have multiple tables. choose the table that you want.
Next you can transform the data how you want such as filter, drop columns, calculate new columns as you see fit. Once done close and load the data.
You might want to set a data refresh interval that is inside the properties (see image below)
Do you like the answer, then upvote it, Enjoy.

Spreadsheet with relationships

I have to work with data CSV file. They look like this
sample
It represents products with options/cars etc. at the web-store.
It has a lot of columns with duplicated values and in my work in often need to copy some part of this data to another sheet, deduplicate it, edit and then paste it back by matching it for one of the columns that were untouched. More this purpose I'm using Ablebits Excel suit.
Is it possible by any excel function to automate this process or maybe there is some other software that could handle this? Something not so complicated as relational databases like Access, but something close to spreadsheet editor with relationships
I already tried Power Query in Excel and Power Bi, but they seem to be more analytics tools and not the data edit
2nd edition:
Data has a layer structure with duplicates.
Title1|Part number 1|Car1
Title1|Part number 1|Car2
Title2|Part number 2|Option1
Title2|Part number 3|Option2
I want to have opportunity to:
Edit values that duplicate without using "Replace All" or at least have more flexible "Find&Replace".
Extract columns with deduplicating them and saving a reference to the place they were taken. So if you edit some data there it was changed in the 1st place. For example, I have titles(a lot of titles) but need to edit it. Instead of copying it with some id to reference it I want to open it like they appears in filters, edit it, confirm and get it edited in all column
I would use Power Query (aka Get & Transform on the Data ribbon in Excel 2016). The only limitation I see with what you want to do is that Power Query will deliver a new Excel Table with the output of a Query - it can't update existing cells.
If you can get past that, Power Query is very flexible, easy to learn (WYSIWYG query editor), scales well and is integrated with other Microsoft products (as well as Power BI, there is integration with SQL Server Analysis Services in preview and hopefully SQL Server Integration Services one day).

Querying single data points from the Excel Data Model / Power Query (Get & Transform Data)

I'm using an up-to-date version of Excel 2016 (via O365 E3 license) and using Power Query / Get & Transform Data. I can successfully create queries and load them to the page. I have also successfully created Power Pivot reports.
I would like to query single data points from the data loaded via Power Query. For instance, imagine a dataset called DivisionalRevenue with:
Date Division Revenue
2016-01-01 Alpha 1000
2016-01-02 Alpha 1500
2016-01-01 Beta 2000
2016-01-02 Beta 400
I could easily load that to an Excel workbook or include it in the data model and create a power pivot. However, Power Pivot doesn't always meet my requirements, particularly around how the data is displayed on the page. In order to achieve my goal I may want to be able to query individual data points.
I would like to have a cell on the page with a formula in it that I can use to query individual data points. If it was in a pivot table I could use something like:
=GETPIVOTDATA("Revenue",$A$3,"Date",DATE(2016,1,1),"Division","Alpha")
The lookup values (date and division) could be retrieved from a cell on the page or hard-coded into the formula. This is a requirement for several reports I'm working on.
Or, I could add a combined lookup column with Date and Division concatenated and use a vlookup to pull the values like:
=VLOOKUP("42371Alpha",I9:L13,4,FALSE)
Finally, I could use a combination of INDEX and MATCH to identify the correct row number and then pull the data.
All of these solutions require the data to be loaded onto a sheet. One requires a pivot table that has to be refreshed to work properly. The other two require creating arbitrary lookup columns so that you can match a row based on more than one field (date and division in this example), and you have to ensure that that lookup field's formula is properly extended down the length of the data table. In both cases I would have concerns when sharing this workbook with my colleagues in case someone affects the rather fragile setup of the pivot table or the lookup.
So, what I truly want to find is something equivalent to pivot table querying against a dataset.
** This doesn't exist, but I would like to know if something like it does **
=GETQUERYDATA("Revenue","DivisionalRevenue","Date",DATE(2016,1,1),"Division","Alpha")
Does such a thing exist? Can such a thing be done? Can I retrieve arbitrary data points from the dataset created through Power Query / Get & Transform Data?
I think that what you want are cubefunctions:
Some Background
How to easy create cubefunctions from a pivot table
There is a feature in Excel that allows you to query off of a PowerPivot model, but it's not highly advertised for some reason.
Once you have the data in your PowerPivot model, go to your Excel -> Data tab -> Existing Connections -> Tables tab
From there, choose the table that you want to start with. Once that table's data is on your excel sheet, you can actually right click that table -> go to "Table" -> "Edit DAX"
From there you can enter the following DAX function, as an example
EVALUATE
FILTER(SampleData,[Date]=DATE(2016,1,1) && SampleData[Division]="Alpha")
Make sure to choose Command Type=DAX in the drop-down. Here's how it looks on my screen:
To further improve your querying power, you can install the optional "DAX Studio" plugin for Excel, which allows you to write custom DAX queries and then export the results directly back to an Excel sheet.

Export large Powerpivot table without data connection

I'm on Excel 2013
Is it possible to EXPORT a powerpivot table and have FULL pivot table drop down functionality without the connected data?
1) I'm using slicers as filters and want to export specific files based on the Filtered Names
2) Would non Power Pivot / Power Query users be able to view my workbook? (I'm thinking probably not)
I've scoured forums and stackoverflow and was unable to find a clear answer.
I've tested it myself and disabled connection and it looks like the LAST format the PowerPivot table was showing would be the view/data that the user sees.
I agree with your test results. Anyone on Excel 2016 / Office 365 should get full functionality.
You might want to try the free Power BI service, where you can upload your Power Pivot model to the cloud and then connect to it using the Power BI Publisher Add-In.
https://powerbi.microsoft.com/en-us/documentation/powerbi-publisher-for-excel/#connect-to-data-in-power-bi
You can set a CSV file with your data as your data source in powerpivot and just point your data model at the CSV. I do this to slim down big models. The data lives in the powerpivot cache level but is not a literal tab in your workbook also much smaller footprint. Works like a tiny database connection. Go to the powerpivot screen choose "From other sources" on the home ribbon, and scroll to the bottom for a text file or CSV. Easiest way to make a pseudo-data mart.
I guess I am not sure what you mean by export the table, The pivot would show without the data connection, but without the full model behind it in the data layer changing anything would just lock it up.

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