Csv.Document
Reads comma-separated (or other delimited) text from a file or binary content and returns a table.
Csv.Document(source, optional columns, optional delimiter, optional extraValues, optional encoding)Returns: A table, with one column for each field. The first row is usually the headers, which you promote in a later step.
What it does
Csv.Document turns a delimited text file into a table. It is the function behind most bank, card and system exports. The three settings that cause most problems are the delimiter (comma, semicolon or tab), the encoding (the way accented letters are stored) and how extra values in a line are handled. Get those right, and the rest of the query is ordinary table work.
Syntax and arguments
source: the file content, as binary. UsuallyFile.Contents("C:\...\statement.csv").columns(optional): the number of columns, or a list of column names. Leave it out to let Power Query work them out from the file.delimiter(optional): the character between fields. The default is a comma. Use";"for European-style exports and"#(tab)"for a tab.extraValues(optional): what to do with a line that has more fields than the header.ExtraValues.Ignore,ExtraValues.ErrororExtraValues.List.encoding(optional): the text encoding of the file, such asTextEncoding.Utf8,TextEncoding.Windows(Windows-1252) orTextEncoding.Unicode.
Example
A bank exports a statement as a semicolon-separated file with accented payee names, saved in Windows encoding. The query reads it correctly.
let
Source = Csv.Document(
File.Contents("C:\Banking\statement-2026-03.csv"),
[Delimiter = ";", Encoding = TextEncoding.Windows, QuoteStyle = QuoteStyle.Csv]
),
Headers = Table.PromoteHeaders(Source, [PromoteAllScalars = true]),
Typed = Table.TransformColumnTypes(Headers, {{"Amount", type number}})
in
Typed
The record form of the settings is what Power Query writes when you use the dialog. The headers come from the first row, and the amount column is typed as a number. If the amount uses a comma as a decimal sign, set the locale in the type step.
Example: a second, different use
Positional form, as in the syntax line: Csv.Document(File.Contents(path), null, "#(tab)", ExtraValues.Ignore, TextEncoding.Utf8) reads a tab-separated file and ignores extra values on a line.
Things to watch
- A wrong delimiter gives one column with everything in it. Check the first rows if the table looks like one column.
- Try UTF-8 first. If names with accents look garbled, switch to Windows encoding. Some banks add a byte order mark, which UTF-8 handles.
- Set the amount type after you check for text such as "(1,250.00)" for negatives, which needs cleaning first.
- Extra values usually mean an unquoted comma inside a field. Fix the file or use quotes, rather than ignoring the lines silently.
In business terms
Bank statements, card transaction files, payroll exports and payment files are often CSV. Getting the delimiter and encoding right, and documenting them, is the first control in a bank reconciliation.