# Is it possible to reference a Power Query in another workbook?



## cr731 (Jan 26, 2016)

I have a workbook containing some Power Query queries.  It's a rather involved set up in pulling from different sources and linking tables, so it's tedious to do.  But I want to use these queries in a few different ways, that require me to have different workbooks storing the output.

Is there a way to reference Workbook A's Power Query model from Workbook B to avoid having to recreate the entire model?

Or is there a better way to basically share the query between workbooks?

I know I can copy/paste from the Advanced Editor, but this is time consuming and if I potentially need to change some part of the query, I need to change it in many places.


----------



## Matt Allington (Jan 28, 2016)

Cut and paste in the advanced editor is the current best method. In Excel 2016 there is better VBA support, but the effort to build something would be more than the cut and paste I think. If you have multiple queries, just save the master workbook with a new name and start from there. 

An alternative approach is to load all the queries as tables in the master workbook. Then do a simple table import into any other workbook that needs it. The second workbook will not trigger a query refresh on the first, so you will need to either manually refresh the first workbook or schedule it using power update or some other method.


----------



## ooptennoort (Jun 8, 2022)

Matt Allington said:


> Cut and paste in the advanced editor is the current best method. In Excel 2016 there is better VBA support, but the effort to build something would be more than the cut and paste I think. If you have multiple queries, just save the master workbook with a new name and start from there.
> 
> An alternative approach is to load all the queries as tables in the master workbook. Then do a simple table import into any other workbook that needs it. The second workbook will not trigger a query refresh on the first, so you will need to either manually refresh the first workbook or schedule it using power update or some other method.


Has PQ evolved in any way since last post to accommodate referencing of queries between, rather than within, workbooks, WITHOUT loading in sheets/tables (or copy pasting the query  ). Perhaps even syncing them??


----------



## ooptennoort (Jun 8, 2022)

ooptennoort said:


> Has PQ evolved in any way since last post to accommodate referencing of queries between, rather than within, workbooks, WITHOUT loading in sheets/tables (or copy pasting the query  ). Perhaps even syncing them??


What about automating data flows (if that is the right jargon)? Can above be achieved with say Power Automate?? (If so, how?)


----------

