add_custom_column
Add a custom column to a Power BI table using an M expression that references existing columns, like [Qty] * [Price].
Instructions
Power Query Add Custom Column: add a column from an M expression. Appends Table.AddColumn(prev, name, each ) to the table's M query. The expression references other columns as [Col], e.g. "[Qty] * [Price]".
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"table": "<table>",
"name": "<name>",
"mExpression": "<mExpression>"
},
"name": "add_custom_column"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | the new column name | |
| table | Yes | ||
| sessionId | Yes | ||
| mExpression | Yes | the M expression, e.g. [Qty] * [Price] | |
| partitionName | No | partition name (optional; defaults to the first partition) |