Pivot Table creating new data source every refresh

%3CLINGO-SUB%20id%3D%22lingo-sub-2218338%22%20slang%3D%22en-US%22%3EPivot%20Table%20creating%20new%20data%20source%20every%20refresh%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2218338%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20like%20the%20title%20says%20I%20have%20a%20pivot%20table%20linked%20to%20a%20dynamic%20data%20source%20(sql%20query)%20that%20changes%20in%20range%20size%20on%20sheet1%20and%20on%20sheet2%20a%20pivot%20table%20that%20is%20just%20used%20to%20format%20the%20same%20data%20with%20subtotals%20and%20totals%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eevery%20time%20I%20refresh%20the%20pivot%20table%20it%20creates%20a%20new%20data%20source%20%22CompanyData2%22%20witht%20the%20number%20incrementing%20and%20the%20data%20won't%20change%20on%20the%20pivot%20table%20cause%20obviously%20now%20it's%20lin%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2218338%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2218505%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%20creating%20new%20data%20source%20every%20refresh%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2218505%22%20slang%3D%22en-US%22%3EIt's%20not%20clear%20how%20that%20SQL%20query%20updates%20the%20source%20data--so%20maybe%20you%20could%20flesh%20that%20out%20a%20bit.%3CBR%20%2F%3E%3CBR%20%2F%3ESpecifically%2C%20does%20ALL%20of%20the%20data%20change%20each%20time%3F%3CBR%20%2F%3EDo%20the%20columns%20involved%20change%3F%3CBR%20%2F%3E%3CBR%20%2F%3EI'm%20going%20to%20assume%20that%20when%20you%20say%20the%20%22range%20size%22%20changes%2C%20you%20mean%20that%20the%20number%20of%20rows%20change%2C%20but%20that%20the%20columns%20stay%20the%20same.%20I'm%20further%20going%20to%20assume%20that%20essentially%20you're%20adding%20new%20data%20(new%20transactions%20with%20new%20dates%2C%20or%20new%20something%20or%20others%20with%20new%20measurements%20associated)...%3CBR%20%2F%3EIf%20those%20assumptions%20are%20accurate%2C%20let%20me%20ask%20if%20the%20data%20set%20is%20established%20as%20an%20Excel%20Table%3F%20If%20it%20is%2C%20and%20if%20it%20could%20be%20clear%20that%20you're%20just%20adding%20rows%20at%20the%20bottom%2C%20then%20it%20should%20be%20possible%20to%20just%20hit%20%22Refresh%20Data%22%20and%20have%20the%20Pivot%20Table%20work%20with%20a%20consistent%20name%20for%20the%20data%20source.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20tell%20me%20(along%20with%20anybody%20else%20reading%20this)%20how%20your%20situation%20differs%20from%20those%20things%20I%20asked%20about%20and%20assumed.%3C%2FLINGO-BODY%3E
New Contributor

Just like the title says I have a pivot table linked to a dynamic data source (sql query) that changes in range size on sheet1 and on sheet2 a pivot table that is just used to format the same data with subtotals and totals etc.

 

every time I refresh the pivot table it creates a new data source "CompanyData2" witht the number incrementing and the data won't change on the pivot table cause obviously now it's linked to the new data source which is totally different. Is there a fix for this?

 

Thanks!

3 Replies
It's not clear how that SQL query updates the source data--so maybe you could flesh that out a bit.

Specifically, does ALL of the data change each time?
Do the columns involved change?

I'm going to assume that when you say the "range size" changes, you mean that the number of rows change, but that the columns stay the same. I'm further going to assume that essentially you're adding new data (new transactions with new dates, or new something or others with new measurements associated)...
If those assumptions are accurate, let me ask if the data set is established as an Excel Table? If it is, and if it could be clear that you're just adding rows at the bottom, then it should be possible to just hit "Refresh Data" and have the Pivot Table work with a consistent name for the data source.

So tell me (along with anybody else reading this) how your situation differs from those things I asked about and assumed.

@mathetes 

okay I attached a screenshot of the data sources, picture 1 is the datapage and pivot table is the pivot table, when I first created the pivot table I told it to get the data from the existing CompanyDataNew table and when I refresh it makes it own with a new number and the other one doesn't do that.

 

 

 

Unfortunately, those images show the SQL, but don't really address the questions and assumptions I made. If all this is about Power Query, I am not in a position to offer help. My questions and assumptions had to do with the Excel portions of your situation (apart from Power Query). If you care to try again, please do. Otherwise, we'll have to await somebody else with Power Query experience.