Forum Discussion
Need help combining 4 worksheets into one
- 5 months ago
Hi Rnaval ,
You can certainly automate this process to run daily. Since your merges are already functioning correctly, you are well positioned for automation. Power Query is designed to repeat all your steps, such as removing duplicates and merging, each time the query refreshes. Therefore, automation mainly involves setting up a consistent refresh schedule rather than changing your existing setup.
If you are using Microsoft Excel, you can configure the query to refresh automatically when the file is opened, ensuring your master file always reflects the latest data. This solution works well if someone opens the file daily. If you require the process to run independently, you may need to use an external tool, such as a scheduled task or a cloud-based flow, to open and refresh the file at regular intervals.
For a fully automated, hands-off process, Microsoft Power BI is often preferable. Once your query is built, you can publish it and schedule daily refreshes, providing a reliable solution for ongoing operations.
Regardless of the method chosen, ensure that your source files remain consistent in terms of file names, locations, column structures, and the IP Address field format. Your duplicate handling logic in Power Query will continue to operate automatically with each refresh. At this stage, you do not need to modify your query logic simply determine the most suitable way to trigger the daily refresh based on your automation needs.
Thank you.
Step 1) Merge the queries
In Power Query:
-
Select your main query
-
Choose Home → Merge Queries
-
Select the second worksheet
-
Click IP Address in both tables
-
Choose the join type
Usually you want:
-
Left Outer → keep all rows from the first sheet, bring matching data from the second
Repeat for the 3rd and 4th worksheets.
Step 2) Expand the merged tables
After each merge, Power Query will create a nested table column.
Click the expand icon and select the columns you want to bring in.
Step 3) Load the final result
Once all merges are done, click Close & Apply (Power BI) or Close & Load (Excel).