Custom function
A reusable function you define in M with =>, such as (qty, region) => …, then invoke from other steps.
A function query can be invoked on every row with Invoke Custom Function, which is how Combine Files works. Parameters can be typed (amount as number) so wrong inputs fail clearly. Functions keep repeated logic in one place, so a fix applies everywhere.
In the Power Query editor
A query whose result shows Enter Parameters; Add Column → Invoke Custom Function calls it per row.
Learn more
Practise it
- advanced~12 minPro
Write a shipping-cost function and apply it (kite shop)
Define a function that prices shipping from quantity and region, then add a Shipping column with it.
- intermediate~9 minPro
Write a tax function with an optional rate (shop)
Define Gross(net, optional rate) that uses 20% when no rate is given, and apply it to every order.
- advanced~12 minPro
Add a running total in date order (consultancy)
Sort claims by date, then add a Running Total of Amount from the first claim to each row.
- advanced~10 minPro
Trim every column except Amount with one generated step (members)
Text columns are padded with spaces, and new ones keep appearing. Build the Table.TransformColumns list from the column names.