Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Query Editor - Can a query source be another loaded query? as opposed to the source file

Hi All

 

Some power query support required!

 

In my queries, i need to build pivot versions of my source data, while retaining the source data itself for various visualisation in my report.

 

The way I did this was simply duplicating the original query, unpivotting and formatting etc.

 

What I have realised since is when I updated the source of original query, the pivot version does not update - it remains based on v1 of the source data. I am now messing about with the advanced editor for each "pivot" version of my queries and it's all rather time consuming. 

 

So my question would be can I have a query with its source being another loaded query in the editor? Or does it always have to be my original excel / csv raw files?

 

I appreciate that a work around could be just overwriting the source data rather than using advanced editor to change it to a new file path, but it would be interesting if my suggested solution could actually be done.

 

thank you all,

 

GC4002

  • Yes.  That is exactly what the Reference feature is.  When you right click on a query to Duplicate it, choose Reference instead.  It uses the output of one query as the input of the new one.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

1 Reply

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Yes.  That is exactly what the Reference feature is.  When you right click on a query to Duplicate it, choose Reference instead.  It uses the output of one query as the input of the new one.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat