Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I comment in Power Query M?

Is there a way to comment M code / comment out lines or blocks of code?

like image 968
Chris Avatar asked Jul 22 '15 17:07

Chris


People also ask

How do you comment in a query editor?

Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 )

What is M code in Power Query?

The M stands for data Mash-up, as power query is all about connecting to various different data sources and “Mashing” them up. M code is the language behind the scenes of power query. When you create a data transformation in the power query editor UI, Excel is writing the corresponding M code for the query.


1 Answers

M supports two different types of comments:

  • Single line comments can be started with //
  • You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2)

Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor.

like image 59
Alejandro Lopez-Lago - MSFT Avatar answered Oct 19 '22 12:10

Alejandro Lopez-Lago - MSFT