let expression
An M construct that binds names to values and returns one of them after in. Applied steps are the bindings of a let expression.
Each name in a let is a binding, separated by commas, and the expression after in is the result. Names can refer to any other binding, not just the one above, which is why a query can return an earlier step for debugging. Names with spaces are written as #"Name".
let
Source = Orders,
Filtered = Table.SelectRows(Source, each [Qty] > 0)
in
FilteredIn the Power Query editor
Open the Advanced Editor: a typical query is one let expression whose bindings are the applied steps.
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.