ML with circles

Mearns Learns

Comments

How to comment and uncomment code in Power Query.

Power Query using the User Interface

Comments can be added via the user interface by following these steps.
Open the Power Query Editor, in the Query Settings sidebar under Applied steps, right click on the step that you want to add a comment to.
Select Properties.

Comments Comments

Enter the comment into the Description box.
Click on the OK button.

Comments Comments

After a comment is added, an information icon will be displayed next to the step.
Hovering over the icon will show the comment as a tooltip.

Comments Comments

Power Query using the Advanced Editor

Single or multi-line comments can be manually added directly in the M code.

Single line comments can be added using a double forward slash //.
Multi-line comments begin with a forward slash and asterisk /* and end with a asterisk and forward slash */.

Comments that are added before lines that are visible as steps in the Applied Steps section of the Query Setting sidebar will be indicated by an information icon in the UI. This applies to multiple single line comments and multi-line comments.

Comments Comments

In Power query, each step usually refers to the previous step.

If you are using comments to comment out code, the row of code immediately after the commented code needs to be updated to refer to the row of code immediately before the commented code.

Don’t try and use this to comment out code before drilling down on errors. The code and any commented code after the step in error will be removed when drilling down.