Excel & Automation
Automating Excel reporting with Power Query
Combine recurring Excel files with Power Query while checking data types, keys, error records and refresh requirements.
Published:
2 min read
This article provides general technical guidance for learning purposes. It is not a customer project or case study.
Turn repeated work into an explicit data contract
Automation is fragile when monthly files change columns, date formats and naming conventions. Establish required fields, row meaning and reporting scope first. Power Query can preserve these rules as repeatable transformation steps.
A folder of sample sales files illustrates the approach. Exclude temporary files and out-of-scope periods and assign explicit types. Keep checks and errors visible so a source change does not silently produce a misleading report.
Append and Merge solve different problems
Append adds rows from similarly structured tables. Merge matches information using keys. If a product lookup has duplicate keys, one sales row can match multiple records and inflate totals.
Record the number of monthly sales files, sales rows and total sales before combining the files. After Append, compare the row count with the sum of the source row counts. Use a left outer merge with the product table and count unmatched product codes. If a code appears twice in the product table, expanding the matches can turn one sales row into two. Compare row counts and total sales again after expansion. Removing duplicates or replacing nulls with zero without understanding the business rule can create another error.
Distinguish refresh from scheduling
A query that refreshes in Excel does not necessarily run automatically while the computer is off. File locations, access and product capabilities determine what is possible. Excel and Power BI Service have different refresh environments.
Query folding can delegate some steps to supported database sources, but it is not available for every connector and transformation. Evaluate performance using the actual query and data rather than assuming every transformation will fold.
Include a reconciliation checklist
The latest data period, source-file count, error rows and critical totals can form part of refresh checks. Users can then assess the condition of the underlying data as well as the report.
ISS Academy Power Query instruction is in Turkish. The Excel or Power BI environment, sources and participants’ knowledge are agreed before the programme. The scenario here explains a method and is not a customer implementation. Power Query training for Excel and Power BI is described on the programme page.
