Forum Discussion

BWatkins's avatar
BWatkins
Copper Contributor
Mar 04, 2022

Re-use my query (Power Query) for a standard weekly sales report

Once a week I extract a sales report (1 file) from salesforce and need to cleanse and transform.  I have created a query against last week's sales extract data and happy with the results.  I have now downloaded this week's sales extract but don't know how to run my query against it (ie, replace last week's data with this week's sales data... and so on weekly). How do I use my query against each week's new sales extract file?

2 Replies

  • Martin_Weiss's avatar
    Martin_Weiss
    Bronze Contributor

    Hi BWatkins 

    it depends on the way how you have set up the first query. So there are several options:

     

    If the source data (the salesforce extract) is in a different file than the query, you just need to open the Power Query editor in the query file, select the step "Source" in the list of applied steps and then change the path and/or filename to the new source file:

     

    If you created the query in the same file as the source data, you could copy/paste the query to the new source file. Just do a right-click on the query name and select "Copy":

     

    In the new source file, do a right-click in the empty Queries & Connections pane and select "Paste"

    You still might need to adjust the "Source" step in the Power Query editor, so it reflects the new table or range.

     

     

    • BWatkins's avatar
      BWatkins
      Copper Contributor
      Thankyou DTE.... I created the query in the same file as my source data (your second scenario) not knowing any better as a first time Power Query user. I will try the copy/paste of the query and work towards redoing all this for a more sustainable week to week use.

Resources