Power query output table and connections

%3CLINGO-SUB%20id%3D%22lingo-sub-1326164%22%20slang%3D%22en-US%22%3EPower%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1326164%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20have%20a%20question%20related%20to%20output%20table%20connections%20in%20power%20query.%20I%20am%20designing%20a%20workbook%20where%20I%20need%20to%20copy%20the%20same%20sheet%20repeatedly%20in%20the%20same%20workbook%2C%20each%20sheet%20has%20two%20queries%20linked%20to%20two%20separate%20tables%20from%20the%20sheet%2C%20these%20queries%20are%20merged%20to%20a%20new%20query%20and%20then%20output%20as%20structured%20data%20in%20a%20output%20table%20in%20the%20same%20sheet.%20When%20I%20make%20a%20copy%20of%20the%20sheet%2C%20the%20output%20table%20in%20the%20second%20sheet%20is%20linked%20to%20the%20query%20from%20the%20first%20sheet%2C%20I%20need%20to%20break%20the%20connection%20link%20and%20link%20the%20output%20table%20to%20a%20new%20query%20copied%20from%20the%20currently%20linked%20query.%20I%20have%20tried%20to%20edit%20the%20Connection%20properties%20but%20all%20the%20options%20are%20greyed%20out%20as%20well%20as%20the%20Get%20Data%20from%20Microsoft%20Query.%20I%20don%60t%20want%20to%20create%20a%20new%20output%20table%20for%20each%20sheet%20as%20it%20would%20mean%20that%20I%20have%20to%20change%20multiple%20formulas%20and%20named%20ranges.%20I%20would%20appreciate%20any%20help%20available%20I%20have%20not%20been%20able%20to%20find%20anything%20on%20this%20matter%20online.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1326164%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1326926%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1326926%22%20slang%3D%22en-US%22%3ERemove%20those%20linked%20query%20loads.%20Open%20your%20queries%20%26amp%3B%20connections%20task%20pane%2C%20right-click%20the%20desired%20query%2C%20load%20to...%2C%20select%20where%20it%20should%20go.%20If%20you've%20already%20linked%20it%20somewhere%20else%2C%20like%20a%20PivotTable%2C%20it%20will%20break%20that%20connection.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1329685%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1329685%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10842%22%20target%3D%22_blank%22%3E%40Zack%20Barresse%3C%2FA%3E%26nbsp%3BThank%20you%20for%20your%20reply%2C%20I%20tried%20this%20but%20it%20wont%20let%20me%20overlap%20the%20table%2C%20and%20I%20don%60t%20want%20to%20erase%20the%20table%20as%20I%20will%20loose%20al%20the%20related%20named%20ranges%20and%20formulas.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1330211%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1330211%22%20slang%3D%22en-US%22%3EI%20don't%20understand.%20If%20it's%20a%20copy%20of%20the%20original%20sheet%20with%20queries%20loaded%20to%20Tables%2C%20remove%20the%20Tables%20and%20start%20with%20your%20new%20queries.%20Any%20old%20named%20ranges%20associated%20with%20your%20old%20Table%20will%20still%20be%20preserved.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1332031%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1332031%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10842%22%20target%3D%22_blank%22%3E%40Zack%20Barresse%3C%2FA%3EThe%20query%20which%20is%20loaded%20as%20a%20table%20to%20the%20sheet%20is%20an%20appended%20query%20of%20two%20tables%20from%20the%20same%20sheet%2C%20when%20I%20make%20a%20copy%20of%20the%20sheet%2C%20the%20appended%20query%20which%20loads%20the%20data%20to%20the%20first%20sheet%20loads%20the%20data%20to%20the%20same%20table%20in%20the%20second%20sheet%20as%20well.%20So%20I%20duplicate%20all%20the%20queries%20and%20link%20them%20to%20the%20same%20tables%20on%20the%20second%20sheet%2C%20so%20now%20all%20the%20queries%20are%20identical%20and%20they%20receive%20their%20feed%20from%20their%20corresponding%20tables%20and%20sheet%2C%20I%20unlink%20the%20appended%20query%20table%20from%20the%20second%20sheet%2C%20so%20now%20the%20power%20query%20table%20from%20the%20second%20sheet%20is%20basically%20a%20table%20with%20headers.%20The%20next%20step%20is%20to%20link%20the%20second%20appended%20power%20query%20to%20the%20table%20on%20the%20second%20sheet%20without%20having%20to%20erase%20the%20table%2C%20the%20reason%20why%20I%20can%20not%20erase%20the%20table%20is%20because%20I%20have%20around%20100%20or%20so%20dynamic%20formulas%20referencing%20columns%20from%20this%20table%2C%20I%20have%20already%20tried%20to%20load%2C%20copy%20paste%2C%20erase%20and%20replace%20cells%2C%20as%20well%20as%20tried%20all%20the%20get%20data%20and%20edit%20connection%20properties%20options.%20But%20nothing%20works%2C%20the%20only%20option%20I%20see%20is%20to%20load%20the%20copied%20appended%20query%20to%20the%20second%20sheet%20and%20to%20correct%20all%20the%20ref%20errors%20on%20the%20formulas%20on%20the%20new%20sheet%2C%20which%20is%20a%20nightmare%20given%20that%20I%20need%2010%20copies%20of%20the%20same%20sheet%20in%20this%20workbook.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1332905%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20query%20output%20table%20and%20connections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1332905%22%20slang%3D%22en-US%22%3EI%20think%20I%20see%20what%20you're%20saying.%20Once%20a%20Table%20is%20unlinked%20it%20can't%20be%20re-linked%20without%20re-creating%20the%20Table%2C%20and%20you're%20hoping%20to%20preserve%20the%20dependent%20calculations.%20Unfortunately%2C%20I%20do%20not%20know%20of%20a%20way%20you%20can%20do%20this%20currently.%20You%20might%20be%20able%20to%20do%20something%20like%20this%20with%20VBA.%3CBR%20%2F%3E%3CBR%20%2F%3EA%20possible%20workaround%20might%20be%2C%20in%20your%20second%20sheet%2C%20load%20the%20desired%20query%20to%20a%20Table%20adjacent%20to%20the%20copied%20Table.%3CBR%20%2F%3E%3CBR%20%2F%3EStep%201.%3CBR%20%2F%3ELoad%20the%20(second)%20query%20to%20(second)%20worksheet.%3CBR%20%2F%3E%3CBR%20%2F%3EStep%202.%3CBR%20%2F%3ERename%20the%20Table.%20You%20should%20have%20two%20Tables%20in%20the%20second%20sheet%3A%20one%20which%20is%20sourced%20to%20your%20first%20query%2C%20another%20which%20is%20sourced%20to%20your%20second%20query.%20Name%20the%20second%20table%20similarly%20to%20its%20neighboring%20Table.%20If%20your%20first%20Table%20on%20the%20second%20sheet%20is%20named%20%22tTable2%22%20then%20maybe%20name%20the%20second%20Table%20on%20the%20second%20sheet%20(the%20query%20you%20want%20to%20be%20loaded%20there)%20something%20like%20%22tTable2_2%22.%3CBR%20%2F%3E%3CBR%20%2F%3EStep%203.%3CBR%20%2F%3EReplace%20formula%20references.%20At%20this%20point%20you%20can%20go%20through%20and%20do%20a%20Find%2FReplace%20for%20all%20formula%20references%20from%20%22tTable2%22%20to%20%22tTable2_2%22%2C%20assuming%20your%20columns%20are%20all%20still%20there%20and%20it%20won't%20break%20anything.%20You%20would%20also%20need%20to%20do%20this%20for%20all%20named%20ranges.%3CBR%20%2F%3E%3CBR%20%2F%3EStep%204.%3CBR%20%2F%3ERemove%20original%20second%20Table.%20You%20should%20be%20able%20to%20now%20safely%20remove%20the%20first%20Table%20on%20the%20second%20sheet%2C%20the%20one%20which%20was%20a%20copy%20of%20your%20first%20Table%20with%20linked%20query.%3CBR%20%2F%3E%3CBR%20%2F%3EPlease%20note%20I%20have%20not%20tested%20this%2C%20but%20the%20theory%20sounds%20workable%20in%20my%20head%2C%20for%20what%20it's%20worth.%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi

I have a question related to output table connections in power query. I am designing a workbook where I need to copy the same sheet repeatedly in the same workbook, each sheet has two queries linked to two separate tables from the sheet, these queries are merged to a new query and then output as structured data in a output table in the same sheet. When I make a copy of the sheet, the output table in the second sheet is linked to the query from the first sheet, I need to break the connection link and link the output table to a new query copied from the currently linked query. I have tried to edit the Connection properties but all the options are greyed out as well as the Get Data from Microsoft Query. I don`t want to create a new output table for each sheet as it would mean that I have to change multiple formulas and named ranges. I would appreciate any help available I have not been able to find anything on this matter online. Thanks

5 Replies
Highlighted
Remove those linked query loads. Open your queries & connections task pane, right-click the desired query, load to..., select where it should go. If you've already linked it somewhere else, like a PivotTable, it will break that connection.
Highlighted

@Zack Barresse Thank you for your reply, I tried this but it wont let me overlap the table, and I don`t want to erase the table as I will loose al the related named ranges and formulas.

Highlighted
I don't understand. If it's a copy of the original sheet with queries loaded to Tables, remove the Tables and start with your new queries. Any old named ranges associated with your old Table will still be preserved.
Highlighted

@Zack BarresseThe query which is loaded as a table to the sheet is an appended query of two tables from the same sheet, when I make a copy of the sheet, the appended query which loads the data to the first sheet loads the data to the same table in the second sheet as well. So I duplicate all the queries and link them to the same tables on the second sheet, so now all the queries are identical and they receive their feed from their corresponding tables and sheet, I unlink the appended query table from the second sheet, so now the power query table from the second sheet is basically a table with headers. The next step is to link the second appended power query to the table on the second sheet without having to erase the table, the reason why I can not erase the table is because I have around 100 or so dynamic formulas referencing columns from this table, I have already tried to load, copy paste, erase and replace cells, as well as tried all the get data and edit connection properties options. But nothing works, the only option I see is to load the copied appended query to the second sheet and to correct all the ref errors on the formulas on the new sheet, which is a nightmare given that I need 10 copies of the same sheet in this workbook.

Highlighted
I think I see what you're saying. Once a Table is unlinked it can't be re-linked without re-creating the Table, and you're hoping to preserve the dependent calculations. Unfortunately, I do not know of a way you can do this currently. You might be able to do something like this with VBA.

A possible workaround might be, in your second sheet, load the desired query to a Table adjacent to the copied Table.

Step 1.
Load the (second) query to (second) worksheet.

Step 2.
Rename the Table. You should have two Tables in the second sheet: one which is sourced to your first query, another which is sourced to your second query. Name the second table similarly to its neighboring Table. If your first Table on the second sheet is named "tTable2" then maybe name the second Table on the second sheet (the query you want to be loaded there) something like "tTable2_2".

Step 3.
Replace formula references. At this point you can go through and do a Find/Replace for all formula references from "tTable2" to "tTable2_2", assuming your columns are all still there and it won't break anything. You would also need to do this for all named ranges.

Step 4.
Remove original second Table. You should be able to now safely remove the first Table on the second sheet, the one which was a copy of your first Table with linked query.

Please note I have not tested this, but the theory sounds workable in my head, for what it's worth.