Contact

Microsoft Excel · Power Query bounded introductory track · Intermediate

Import and refresh data with Power Query

Import a local CSV with Power Query, load the results, and refresh a saved source change without confusing preview and worksheet data.

Official documentation reviewed; synthetic fixtures checked independently; not executed in Excel · Editorial standards

Quick answer: Use Data > Get Data > From File > From Text/CSV, inspect the preview, and load the query. When the source changes, refresh the loaded worksheet query. Refreshing only the Power Query Editor preview does not update the worksheet result.

Scope and prerequisites

Use English Excel for Microsoft 365 desktop on Windows with Power Query available. Windows, Mac, and Excel for the web all have Power Query capabilities, but their supported sources, editing interfaces, authentication, and refresh options differ. These local-file Windows steps are not a promise of identical Mac or browser support. No database, cloud account, or paid connector is needed.

Create a plain-text file named sales-practice.csv in a folder you control. Save these exact contents, including the header row:

Order,Region,Amount
A01,North,120
A02,South,80
A03,North,50

The expected result has three data rows, three columns, and an Amount total of 250. Order is an identifier, not a measure. Keep this source file separate from the Excel workbook that will hold the query results.

Connect and inspect

  1. In a blank workbook, choose Data > Get Data > From File > From Text/CSV.
  2. Select sales-practice.csv and import it. Inspect the delimiter and preview before continuing: the fields must occupy three columns, not one column containing commas.
  3. Choose Transform Data to inspect the data in Power Query Editor.
  4. Confirm that the first row supplies the column names. Set Order and Region to Text and Amount to a numeric type, such as Whole Number, using the column data-type controls.
  5. Review Applied Steps. These steps form the reusable query; they are not edits to the original CSV.
  6. Choose Home > Close & Load to load the result into the workbook. Rename the result sheet to QueryResult so it is not confused with a source sheet.

Inspect all three identifiers and amounts. Select the result table and set its Table Design table name to ImportedSales. In E1 enter Checked total and in E2 enter =SUM(ImportedSales[Amount]). This off-table check expands with the table and stays out of its A:C growth area. See SUM for the calculation. Do not insert manual corrections directly into the query’s output table and expect them to survive the next refresh.

Refresh a known source change

Open the CSV in a text editor and change A02’s Amount from 80 to 100. Add this final row and save the CSV:

A04,South,30

In Excel, select a cell in the loaded query table and choose Query > Refresh > Refresh. Wait for the operation to finish before reading its results. The expected output now contains four data rows with amounts 120,100,50,30, totaling 300. The increase of 50 comes from a 20 correction plus a 30 addition.

If instead you use Home > Refresh Preview inside Power Query Editor, you update the preview/cache. That is not the same as refreshing the loaded worksheet. Close and load the edited query or refresh the worksheet query before checking the worksheet total.

Save and diagnose failures

Save the report as XLSX, close it, and reopen it. Check the displayed 300 total, then refresh again with the source file still available. A saved result is a snapshot; a successful refresh additionally proves the current source can be read.

If the file has moved, repair its source path rather than repeatedly refreshing the old location. If the total remains 250, confirm you saved the CSV, refreshed the intended query, and selected the output sheet rather than another table. If privacy or access restrictions appear, resolve them through the authorized source settings; do not disable protections to make the example run. See privacy-safe Formula Firewall fixes for that separate issue.

Hand off two monthly snapshots without trusting a total alone

Treat Month A and Month B as synthetic reporting snapshots, not two files to combine. Use a new disposable practice folder and a new workbook for this extension. A copied workbook can still point to its old source: repeat the connection steps above against the full path of the new folder’s sales-practice.csv, then name the loaded table ImportedSales. Leave your earlier source and workbook untouched. This remains the Windows desktop route above, not a free-web or subscriber-web parity claim. Use only an installation and access you already have; do not purchase, activate or change account permissions for this exercise.

In that new folder, keep these two plain-text archival files unchanged. They are reference snapshots, not the connected source and not a folder-combine input.

sales-month-a.csv — original three-record snapshot

Order,Region,Amount
A01,North,120
A02,South,80
A03,North,50

sales-month-b.csv — corrected and extended four-record snapshot

Order,Region,Amount
A01,North,120
A02,South,100
A03,North,50
A04,South,30

The contract is exactly three headers in that order: Order,Region,Amount; Order and Region are Text, and Amount is Whole Number in the query. Each listed ID must occur once with its listed region and amount. The month label belongs in your checking record; it is not an extra CSV column. These inline contents are instructions for a disposable exercise, not supplied or native-tested downloads.

Check the active source and the loaded result separately

  1. Copy the entire text of Month A, including its header, into the new folder’s active sales-practice.csv and save it. Confirm its full path matches this new workbook’s connection; keep both archival files untouched. Import/load it as above, retaining the explicit types.
  2. Keep =SUM(ImportedSales[Amount]) in E2. Outside the table’s A:C area, enter Data rows in E4 and =ROWS(ImportedSales[Order]) in F4; enter Numeric amounts in E5 and =COUNT(ImportedSales[Amount]) in F5. These count the table’s data records and numeric Amount entries, not the header. Check every record as well as the three controls below.
  3. Replace the active file’s complete contents with Month B and save it at the same controlled path. Do not append Month B to Month A, connect to a different archive accidentally, or edit the loaded query output. Refresh the loaded worksheet query and wait for completion before checking it.
Snapshot to accept IDs, each occurring once Data rows (F4) Numeric amounts (F5) Amount total (E2)
Month A A01, A02, A03 3 3 250
Month B A01, A02, A03, A04 4 4 300

For Month B, reconcile the 50 increase: A02 rises by 20 and A04 contributes 30. A01 remains North/120, A02 is South/100, A03 remains North/50 and A04 is South/30. Matching just the sum or the ID set is insufficient: compare each ID’s region and amount too.

Keep a small record outside the workbook with the intended month, archival filename, active full path, workbook full path, query/table name, refresh completion or failure, and the observed IDs/regions/amounts, F4, F5 and E2. Begin its execution-result fields as NOT RUN; enter actual observations only after doing the check. If you reopen a saved workbook, record that separately from a fresh successful worksheet refresh. An old saved 250 can be a valid Month A snapshot while being wrong for a Month B handoff. An editor preview showing 300 also does not establish that the worksheet changed: Microsoft’s refresh guidance distinguishes the preview/cache operation from refreshing the loaded result.

Break the record contract, repair it, then restore Month A

In the active disposable file only, start with the exact Month B contents and change the final ID from A04 to A99, leaving South and 30 unchanged. Save and refresh the loaded worksheet. The mathematical controls are still 4 rows, 4 numeric amounts and 300, with four distinct IDs. Nevertheless, this is not an acceptable Month B result: A04 is missing and unexpected A99 is present. This deliberate counterexample shows why even a balanced total and a row count need an exact record check. Do not alter an output cell to disguise the mismatch.

Repair by replacing the active file’s complete contents with the unchanged Month B archive, then save, refresh and verify all four exact records and 4 / 4 / 300 again.

For a brief schema-contract check, change only the active file’s header Amount to Value. The header contract now fails even if a saved table still displays 300. A query step referring to Amount may also fail; no particular native error display is claimed here. Restore the entire Month B source text, refresh the worksheet and repeat the record and numeric checks. Microsoft’s column-header guidance explains why source-header changes can affect dependent steps. For the detailed moved-path and schema-repair procedure, continue with Manage query refresh and source changes without losing results as a separate exercise; that guide’s A1/A2 fixture is not a replacement for these A01–A04 records. Do not delete a failing type step or relax privacy protections merely to obtain a displayed total.

Finally, replace the active sales-practice.csv with the complete Month A archive. Save, refresh the loaded query, and confirm A01=North/120, A02=South/80, A03=North/50, no A04 or A99, and 3 rows / 3 numeric amounts / 250. Save this restored practice workbook under a clear name and record its full location; any close/reopen and subsequent refresh are reader checks, not tests reported by this page. Both archival snapshots and the earlier exercise remain unchanged.

Verification boundary: The snapshot arithmetic and deliberate failure models are independently calculated; the documentation was reviewed on 29 October 2026 (America/Toronto). No Excel query, local file handoff, refresh, entitlement, saving or reopening was executed for this extension. Qualified downloadable sources and native workflow verification remain unfinished.

Official references