Power BITutorials

How to Add Comments In M Using Power Query

1 Mins read

You can add comments to your code either with single-line comments that start with ‘//’ or multi-line comments that start with ‘/*’ and end with ‘*/’. Comment plays an important role to understand the code. In the future, if you want to change some part of code or want to share your code with your friend, who can easily understand code without your help then comment in code is important.

There are many Power Query Tips & Tricks that used to transform and clean your data. You can learn other Power Query Tricks at our Power Query Online Training Program. Join today and become a Power Query Expert.

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Adding Comments In M With Power Query

Let’s take an example to see how it works.

Step 1: Load Data in Power Query

Load the data in Power Query first to apply comments in M as shown below. Perform some action to the data table loaded in Power Query. Here we have merged the columns.

LOAD DATA IN POWER QUERY

Step 2: Open Advanced Editor

To open Advanced Editor in Power Query click on

Home > Advanced Editor

OPEN ADVANCED EDITOR

Step 3: Add Comments in M

Add a single comment to the query for merging columns in the Advanced Editor dialogue box as shown below. We have added the comment //Merge Columns to the Advanced Editor.

ADD COMMENTS IN M

Step 4: Close & Apply

The picture below shows the data table after merging the columns and adding comments in Query Editor. Now you can close and apply the changes.

DATA TABLE AFTER MERGING COLUMNS

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Related posts
AlteryxTutorials

Alteryx Hotkeys - Alteryx Keyboard Shortcuts

2 Mins read
Top 50+ Alteryx Shortcuts for Windows. Alteryx is popularly known as a Self-Service Analytics tool. Business users can build their data workflows…
AlteryxTutorials

Step By Step Guide to Learn Alteryx

6 Mins read
Alteryx Learning Path: The growth in technology has resulted in growth in understanding. In today’s world, humans – fellow businessmen know the…
Excel VBA CodeTutorials

VBA Code to Clean the Date Format

1 Mins read
When it is useful? Most of the time the most annoying problem is when the data is taken from ERP or other…