Importing a CSV file using M
One of the things that we do on a fairly regular basis is open CSV or Excel files. Although we can do this within Power Query, if we wanted to do this with M, we could do so in two different ways. The first way is to use the Advanced Editor window in the Power Query editor, and the second way is to type M
into the formula bar in the Power Query editor.
When we open Advanced Editor, we can type the following:
let salesData = Csv.Document(File.Contents('C:\DataFiles\sales.csv'), [Delimiter=',', Encoding=1252]) in salesData
If, however, you wanted to type this in directly without using the editor, then type type = Csv.Document(File.Contents('C:\DataFiles\sales.csv'), [Delimiter=',', Encoding=1252])
into the formula bar, which will do the same thing.
This will then import the CSV file, but there are two...