Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power Query help - replicating queries for similar sources

Hello,

 

I am attempting to import sales data from six DNSs via ODBC and then append them after adding the company name as a custom column in PowerQuery. I need to do a number of transformations to the data before the append. Is there an efficient way to automatically copy changes between the queries rather than manually copying my work over 6x for each change? This would also allow me to modify the query later without have to make 6 modifications.

 

For example, I might remove other columns, rename columns, add a custom column, add an index and then add up to columns. I would take the exact same steps for all 6 companies and then append.

 

Thanks

MCK

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,


If the data source of the same type is imported. May wish to refer to the following steps:

First clean the data in a data source, then open the "advanced editor" and copy the code inside.

v-henryk-mstf_0-1613442644777.png


Click on the second data source and copy the code to the "advanced editor", the results of the same operation as the first data source will be displayed.

v-henryk-mstf_1-1613442722088.png


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,


If the data source of the same type is imported. May wish to refer to the following steps:

First clean the data in a data source, then open the "advanced editor" and copy the code inside.

v-henryk-mstf_0-1613442644777.png


Click on the second data source and copy the code to the "advanced editor", the results of the same operation as the first data source will be displayed.

v-henryk-mstf_1-1613442722088.png


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PhilipTreacy
Super User
Super User

Hi @Anonymous 

You can write those steps in a function and then call the function from each query.

Further info https://www.myonlinetraininghub.com/power-query-custom-functions 

regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.