
If you searched “import csv power query excel”, you already suspect the truth: double-clicking a CSV is the amateur move. Power Query — the Get & Transform engine built into modern Excel — imports your CSV through a repeatable, refreshable pipeline that fixes delimiters, data types, and dirty data on the way in. Learn it once, and every future CSV takes seconds instead of a morning of cleanup.
This tutorial walks through the complete pro workflow: the exact clicks to import a CSV with Power Query, the transform steps that fix real-world messes (wrong delimiters, text-dates, junk rows), how to nail data types so numbers stay numbers, how to make the import refreshable so next month’s file updates itself, M code basics for reading and tweaking the generated query, and loading big files into the Data Model. You will also get troubleshooting for the errors everyone hits, like type-conversion failures and refresh errors.
Power Query ships built into Excel 2016 and later, including Microsoft 365 on Windows and Mac — no add-in needed. If you prefer a zero-setup option for smaller files, our free CSV to Excel converter handles them in the browser; but for recurring or messy imports, what follows will change how you work.
Why Power Query Beats Opening a CSV Directly
Double-clicking a CSV hands all parsing decisions to Excel’s defaults: it guesses the delimiter from your Windows locale, guesses data types from the first few rows, and applies them silently. A semicolon-delimited file on a US machine opens as one giant column. Leading zeros vanish from ZIP codes. Dates flip between US and UK interpretations. And you get to redo every fix manually, every time the file arrives.
A Power Query CSV import flips this around: every decision becomes an explicit, recorded, replayable step. You declare the delimiter, set each column’s type, remove junk rows, and rename headers — once. The query saves those steps, and refreshing replays them on the new file. The practical differences:
- Repeatability: the same cleanup runs identically every refresh — no more “did I fix the dates last time?”
- Transparency: the Applied Steps pane shows every transformation in order; click any step to see the data at that stage.
- Scale: load to the Data Model and analyze millions of rows that would never fit the grid (see our large CSV guide).
- Safety: the source CSV is never modified; all transforms happen in the query.

Import CSV Power Query Excel: Step-by-Step Tutorial
Here is the core import csv power query excel workflow, start to finish. Follow along with any CSV.
- Start the import: In Excel, go to Data > Get Data > From File > From Text/CSV and select your file.
- Check the preview: The dialog shows the delimiter Power Query detected, the encoding, and a data preview. If the preview looks wrong (one column, strange characters), change the delimiter or encoding here before continuing.
- Open the editor: Click Transform Data — not Load. This opens the Power Query Editor, where the real work happens.
- Promote headers: If the first row contains column names, use Home > Use First Row as Headers.
- Set data types: Click the type icon at the left of each column header (ABC, 123, calendar) and set the correct type. Do this deliberately — do not trust auto-detection on important columns.
- Clean: Remove unneeded columns (select, right-click, Remove), filter out junk rows, rename headers.
- Load: Click Home > Close & Load to put the table on a worksheet — or Close & Load To… for options like loading to the Data Model.
That is the whole loop. Steps 1–3 take thirty seconds once you know them; steps 4–6 are where you encode your knowledge of the file so you never repeat the cleanup.

Transform Steps That Fix Real CSV Problems
The Power Query Editor’s Applied Steps pane is a recipe: each step you add is recorded and replayed on refresh. These are the transforms that fix the problems real CSVs actually have.
Skip junk rows at the top
Exports often start with title lines, blank rows, or report metadata before the real header. Use Home > Remove Rows > Remove Top Rows and enter the count — then promote the real header row. This beats manually deleting rows every month.
Split columns
A “Name” column holding “Smith, John” or an address crammed into one field splits cleanly with Transform > Split Column > By Delimiter. Choose the delimiter, and whether to split at each occurrence or just the first — “Last, First” splits once on the comma.
Replace values and trim
Transform > Replace Values standardizes entries (“N/A”, “n/a”, “NA” → null), while Format > Trim and Clean remove stray spaces and non-printable characters that break lookups. Invisible trailing spaces are a top cause of “my VLOOKUP doesn’t match” — trim text columns as a matter of habit.
Unpivot messy layouts
CSVs shaped like reports — months as columns, values scattered — unpivot into tidy data with Transform > Unpivot Columns. Select the month columns, unpivot, and you get clean Attribute/Value rows ready for pivot tables. This single step rescues more “unusable” exports than any other.
Filter with intent
Use the column filter dropdowns to keep only what you need — but remember filters are steps too, so “exclude rows where Status = TEST” becomes a permanent, documented rule rather than a manual deletion you might forget.

Getting Data Types Right
Data-type errors are the number-one silent killer in Power Query CSV imports. Power Query samples the first ~1,000 rows to guess types, and real files defeat sampling constantly: a phone-number column that starts with blanks gets typed as number and loses leading zeros; a date column with one “TBD” entry fails conversion for the whole column.
The pro habit is explicit typing. After promoting headers, go column by column and set types with the icons: ABC (text) for IDs, codes, phone numbers, and anything with leading zeros; 123 (whole/decimal number) for amounts and quantities; calendar (date) for dates. When in doubt, type it as text — text never corrupts data, it just limits math, and you can convert later with full control.
Locale-aware dates and numbers
This is where US, UK, Indian, Canadian, and Australian users get bitten differently. A CSV with “03/04/2026” is March 4th in the US and April 3rd in the UK — and Power Query parses it according to your Excel locale. For ambiguous dates, use Transform > Date > Parse > Using Locale and explicitly choose the source locale. Same for numbers: European files with “1.234,56” need the right locale or the decimal lands in the wrong place. Our locale guide and date format guide cover these traps in depth.
Handle conversion errors gracefully
When a type change fails on some rows, Power Query flags errors instead of guessing. Right-click the column and choose Replace Errors (with null or a default) or Remove Errors — as an explicit step, so the decision is documented. Never ignore error counts; each one is a data-quality signal.

Refreshable Queries: Never Rebuild the Import Again
Here is where the import csv power query excel approach pays for itself permanently. Once your query exists, updating it for a new file is one click: Data > Refresh All. Every transform step replays against the fresh CSV. The monthly report that used to eat your Monday morning now takes ten seconds.
Three refresh patterns cover nearly every workflow:
- Same filename, new data: overwrite the CSV in place (same path, same name) and refresh. Simplest — the query points at the path, not the content.
- New file each period: use From Folder instead of From Text/CSV, so the query always reads the latest file (or combines all of them — see our merge guide).
- Refresh on open: right-click the query in Data > Queries & Connections, choose Properties, and tick “Refresh data when opening the file”. The workbook updates itself for whoever opens it.
One caution: refresh re-reads the source path, so do not rename or move the CSV afterward — or update the source step (click the gear icon on the Source step) to point at the new location. Broken source paths are the most common “my query stopped working” cause, and the fix takes five seconds once you know where to look.

M Code Basics for CSV Imports
Every click in the Query Editor writes M, Power Query’s formula language. You do not need to master it, but reading the generated code demystifies errors and lets you make tweaks the UI cannot. Open View > Advanced Editor to see your query — a typical CSV import looks like this:
let
Source = Csv.Document(
File.Contents("C:\data\sales.csv"),
[Delimiter=",", Columns=6, Encoding=65001, QuoteStyle=QuoteStyle.None]
),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(
#"Promoted Headers",
{{"OrderID", Int64.Type}, {"OrderDate", type date},
{"Customer", type text}, {"Amount", type number}}
),
#"Filtered Rows" = Table.SelectRows(#"Changed Type",
each [Status] <> "TEST")
in
#"Filtered Rows"
Read it as a pipeline: Source reads the file (note Encoding=65001, which is UTF-8 — change it to 1252 for Windows-1252 files), then each step transforms the previous one, and in names the final result. The three edits worth knowing:
- Change the file path: edit the path in
File.Contents("...")to repoint the query — faster than rebuilding when files move. - Fix the delimiter: change
Delimiter=","to";","|", or"#(tab)"for tab-delimited files. - Parameterize: replace the hardcoded path with a parameter (Home > Manage Parameters > New Parameter) so one query template serves many files — the foundation of the reusable CSV import template pattern.
Do not fear the Advanced Editor: Power Query regenerates the UI steps from whatever M you save, so small hand-edits are safe. If you break something, the step list shows exactly where — delete the bad step and continue.
Once you are comfortable reading M, two functions earn their keep in CSV work. Table.SelectRows with a custom predicate filters on logic the UI dropdowns cannot express — for example, keeping rows where the amount is positive and the date falls in the current year. Table.ReplaceValue with a replacer function handles pattern-based cleanup, like stripping currency symbols before converting to numbers. You will rarely write these from scratch; instead, build the closest thing in the UI, open the Advanced Editor, and tweak the generated line. That UI-first, edit-second loop is how most Power Query users actually learn M.
Loading Big CSVs into the Data Model
When your CSV has more than 1,048,576 rows, loading to a worksheet is not an option — but loading to the Data Model is. In the Query Editor, choose Close & Load To…, select “Only Create Connection”, and tick “Add this data to the Data Model”. The data lives in the workbook’s columnar in-memory engine instead of the grid, so several million rows fit in one file, and you analyze them with pivot tables and DAX measures.
Practical guidance: drop columns you will not analyze before loading (each one costs memory), set data types explicitly (text compresses worse than numbers), and expect roughly 2 GB as the soft model-size ceiling. A 5-million-row sales file with dates, regions, and amounts typically compresses to a few hundred megabytes — comfortable on a 16 GB machine. Full details in our large CSV to Excel guide.

Share and Reuse Your Queries
A well-built CSV import query is an asset — treat it like one. To reuse a query in another workbook, open Data > Queries & Connections, right-click the query, and choose Copy, then paste it into the other workbook’s Queries pane. The M code travels with it, including every transform step; you only need to repoint the Source step at the new file path.
For teams, the cleanest pattern is a template workbook: one XLSX containing the finished query (set to refresh on open) plus any pivot tables or charts built on top, saved as an .xltx template or just shared read-only. Colleagues open it, it pulls the latest CSV, and everyone works from identical logic — no more “which version of the cleanup did you use?” This is the same idea as our reusable CSV to Excel template, implemented with Power Query instead of macros. One warning: queries store absolute file paths by default, so agree on a shared folder structure (or use parameters for the path) before distributing, or every recipient will hit the “couldn’t find file” error from the troubleshooting section.
Troubleshooting Power Query CSV Imports
Everything lands in one column
Wrong delimiter detected. In the preview dialog (or the Source step’s gear icon), set the delimiter explicitly — comma, semicolon, tab, or pipe. European and Indian exports often use semicolons; US exports usually commas.
Strange characters (é, ’)
Wrong encoding. Try UTF-8 (65001) first, then Western European / Windows-1252 (1252). Files from older systems are the usual suspects; the preview updates live as you switch, so you can see the fix instantly.
“We couldn’t convert to Number” errors
Mixed content in a numeric column — a “TBD”, a currency symbol, a thousands separator. Either clean the values first (Replace Values) or type the column as text and convert selectively afterward.
Refresh fails with “couldn’t find file”
The source CSV moved or was renamed. Open the query, click the gear on the Source step, and repoint the path. Consider moving to a From Folder query so future files just work.
Query is slow on large files
Remove unneeded columns early (each one is parsed and stored), avoid sorting or merging huge tables mid-query, and filter rows as early as possible — Power Query is fastest when it carries less data through fewer steps.
Power Query has a learning curve, but every error teaches a reusable pattern — and if you hit one that stumps you, join the discussion in our community forum with your M code and a data sample; the community debugs these daily.
Frequently Asked Questions
How do I import a CSV into Excel with Power Query?
Go to Data > Get Data > From File > From Text/CSV, select your file, click Transform Data to clean it in the Power Query Editor, then Close & Load. The import becomes a refreshable query you can rerun anytime with Data > Refresh All.
Where is Power Query in Excel?
In Excel 2016 and later, including Microsoft 365, Power Query is built into the Data tab as Get Data and the Get & Transform Data group. In Excel 2010/2013 it was a free add-in called Power Query. On Mac, it is in the Data tab of Microsoft 365 Excel.
Why does Power Query change my data types?
Power Query auto-detects column types from a sample of rows, which misfires on mixed data. Set types explicitly with the type icons in the Query Editor — text for IDs and codes, numbers for amounts, dates for dates. You can also disable automatic type detection in the query options.
Can Power Query import a CSV automatically on a schedule?
Power Query refreshes on demand with Data > Refresh All, and queries can refresh when the workbook opens. True unattended scheduling without opening Excel needs Power Automate or a script — see our PowerShell automation guide.
How do I refresh a Power Query CSV import?
Click Data > Refresh All, or right-click the query in the Queries & Connections pane and choose Refresh. The query re-reads the CSV and replays every transform step automatically — that is the whole point of the import csv power query excel workflow.
Does Power Query work on Mac?
Yes — Power Query is available in Excel for Mac through Microsoft 365, covering core CSV import, transform steps, and refresh. A few advanced features (like From Folder combine) arrived later on Mac than Windows, so check your version if you need them.