Skip to content
Home » Add comments to Power Query steps

Add comments to Power Query steps

Whenever you do a transformation in Power Query, it adds a steps for each transformations.

It is always a good practice to add a short description or comment about the transformations that you do. It keeps the documentation of your code.

So that, you can quickly get to know the use of M code by just reading the comment rather than reviewing complete M code to understand the purpose of  transformation.  Which saves a lot of time reviewing complex transformation.

As you can see here we have a table.

Lets, add a comment about pivoting steps. For this, just click on Advance Editor.

Once you click on Advance Editor, you can see the M code of each transformation that you have done in Power Query as shown below.

In this M code you can write a comment or short description about your transformation.

Let’s put a comment about pivoting steps. Just put the cursor in the starting of

“Pivoted Column” steps and hit enter in order to add a new line just above this line.

Now  you can add comments to your code with single-line comments // or multi-line comments that begin with /* and end with */ .

After writing the comment, just click on Done button.

Once, you click on Done button. You will see a white colored information icon display at the end of “Pivoted Column” steps and when you hover on this icon it displays the information about the step.

It is really useful rather than clicking and reviewing the each transformation to understand the M code you can simply look at the comment to understand the purpose of M code.

Also Read..

Replace multiple columns values in Power Query

Power Query Tutorial

Power BI DAX Tutorial

Learn SQL


 234 total views,  2 views today

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.