M language
Power Query's formula language. It's functional and case-sensitive: every query is an expression, typically a let … in block, that produces a value such as a table.
M is a functional language: values never change, and each step produces a new value from earlier ones. It has its own types (text, number, date, list, record, table, function) and its own standard library of several hundred functions such as Table.SelectRows. It's not the same as DAX, which calculates measures over a loaded model.
In the Power Query editor
The formula bar shows the M for the selected step, and Home → Advanced Editor shows the whole query.
Learn more
Practise it
- intermediate~9 minPro
Build a one-row summary table in M (kite shop)
Write a let expression that computes order count, total quantity and the largest unit price, returned as a one-row table.
- intermediate~9 minPro
Build a calendar from the first to the last order date (kite shop)
Create a table with one row for every day from the earliest to the latest order date, including days with no orders.
- beginner~6 minPro
Turn a settings object into a Name/Value table (report config)
A JSON settings file is a single object. List its settings as rows with Name and Value columns.
- intermediate~7 minPro
Find customers who ordered in January but not in February (kite shop)
Compare the customer lists of two months and return the customers who didn't come back.