Downloads

Power Query M explainer

Paste a Power Query M query and get every step explained in plain English, with reference links, folding hints and a re-indent button.

Privateto your browserwhat you paste is not sent anywhere

Step by step

Press Explain this query to read each step. Hints about query folding appear here, with the step they belong to.

Re-indented M

Each step on its own line, long calls broken one argument per line.

  

How it works

  1. Paste your query

    Paste the whole let ... in query from the Advanced Editor.

  2. Read each step

    Every step gets a plain-English explanation with a link to its function.

  3. Fix the slow parts

    Query folding hints point to the step that breaks it.

How the explainer reads a query

Power Query stores each transformation as a named step inside a let ... in block, separated by commas. The explainer finds the top-level let and in, then splits the steps at the commas that are not inside brackets, quotes or a nested let. Step names written as #"Changed Type" are read as one name, and comments are skipped.

For each step the explainer finds the first function call, such as Table.SelectRows, and gives a one-line plain description from a built-in list of 80 common functions. A link goes to the function reference page when that page exists. It also lists the earlier steps it uses and the text it mentions, such as column names.

The performance hints point at steps that often stop query folding. Folding means the database does the work, instead of Power Query pulling every row back. Buffering a table, adding an index column, sending your own SQL with Value.NativeQuery, and calling a custom function in a row step are the common cases. The hints use words such as "often" and "may" because folding depends on the source and the connector.

What it does not do

Frequently asked questions

Where do I find the M code of a query?

In Power Query Editor, open the Advanced Editor. It is on the Home tab in Power BI and on the View tab in Excel. Copy everything from let to the last line, and paste it here.

Why does a step say "No function call here"?

The step picks an item out of a record or a table, often a table from the source, such as Source{[Schema = "sales", Item = "orders"]}[Data]. It may also refer to an earlier step with no function.

Why is there no link for a function?

Either the function is not in the reference yet, or it is a custom function written in this query. Only functions with a reference page get a link.

Does the tool send my query anywhere?

No. The explainer and the re-indent run in your browser. The page reads the list of function reference pages from this site, nothing else.

What is the example?

A small accounting query that loads orders and order lines from the classicmodels sample database, joins them, works out line revenue, groups it by month and removes cancelled orders. You can read it as a model for your own queries.

More tools: all tools · function reference · guides