Actually I'm working on a guide, but it won't be available shortly.
But I can share the draft text about 'each' and '_':
When performing conversions on structured values (lists, records, tables), the conversions are actually applied to each element of the structured value. So when adding a column to a table, each value in the new column is determined using the same conversion function.
An example: add column “b” to a table as 10 * the values from column “a”:
Code:
Added_b = Table.AddColumn(MyTable,”b”, each 10 * [a])
The parameter starting with each is actually a function, according to the syntax of Table.AddColumn:
Code:
Table.AddColumn(table as table, newColumnName as text, [B]columnGenerator as function[/B], optional columnType as nullable type) as table
So this querystep can be rewritten as:
Code:
columnGenerator = each 10 * [a],
Added_b = Table.AddColumn(MyTable, "b", columnGenerator)
In fact,
keyword each is equivalent with function parameter _, so the first function can be rewritten as:
Code:
Added_b = Table.AddColumn(MyTable,”b”, (_) => 10 * [a])
Which is equivalent with:
Code:
Added_b = Table.AddColumn(MyTable,”b”, (_) => 10 * _[a])
It is allowed to omit the _ parameter, but this is restricted to _ only, so this won’t work:
Code:
Added_b = Table.AddColumn(MyTable,”b”, (x) => 10 * [a])
The correct code:
Code:
Added_b = Table.AddColumn(MyTable,”b”, (x) => 10 * x[a])