Editing experience-generated code
As pointed out in this chapter’s Your first query section, using the Power Query Desktop experience’s graphical user interface (GUI) to connect to and transform data generates M language code. This code generated can be tweaked or edited using the formula bar.
For example, in the Applied Steps area of the Query Settings pane, by clicking on the Source step for the query and then clicking the down arrow to the far right in the formula bar, you can see the full M language code for the Source step, such as the following:
= Csv.Document(File.Contents("C:\Users\gdeck\OneDrive\Books\The Definitive Guide to Power Query\Chapter 2\Chapter 2 - Product Inventory.csv"),[Delimiter=",", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None])
As you can see in this code, there are two nested functions being used to connect to the CSV file, Csv.Document
and File.Contents
.
- The
File.Contents
function has a single...