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

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.

Related

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.

How to create a new table from Query data and change rows to column in Power BI

I am new to Power BI. I have searched a solution, but I can't find the one match my issue.
I use direct query to SQL Server to generate data table in Power BI. My query result as below:
And I want to create a new table and transform the data to be as below:
Really appreciate any help or idea.
Thanks
You need to pivot the Factory column to get the desired result.
In Power BI Desktop designer, click Transform data button from the Home ribbon tab to open Power Query Editor. First, delete the Comment column (or don't select it at first place) by right clicking on it's title and select Remove. You don't need it. Then select Factory column and click Pivot Column button from Transform tab:
and select Volume for values column:
This will pivot the column, i.e. make a separate column for each of the values in it, and give you the desired result:
In addition (you said you are using a DQ to get the data), you can also do the same transformation in the database query too.

Excel - pivot table - update data model

I am working with a pivot table and need the functionality of counting distinct items. To do this I click the option to 'Add To The Data Model' at the bottom of the 'Insert Pivot Table' dialogue box and everything work fine.
The issue is after I build a pivot table off of the data, how do I add new rows or columns. With a typical pivot table, I'd Click the analyse tab, select the new data range and hit refresh.
Is there a way to do this for a pivot table where the data has been added to the data model?
Generally, it works the same way - if you hit "refresh all" in Data, that should take care of it.

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!

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