group_by
Aggregate rows by key columns with sum, count, average, min, max, or distinct count. Appends a Table.Group step to the Power Query M code for summarization.
Instructions
Power Query Group By: collapse rows to one per key-column combination with aggregates. Appends Table.Group to the table's M query. keyColumns is comma-separated. aggregations is comma-separated as name:op[:column], e.g. "Total:Sum:Amount,Lines:Count,Distinct Customers:CountDistinct:CustomerId". op = Sum | Count | Average | Min | Max | CountDistinct | All (column required except for Count/All).
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>",
"keyColumns": "<keyColumns>",
"aggregations": "<aggregations>"
},
"name": "group_by"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| sessionId | Yes | ||
| keyColumns | Yes | the grouping key columns, comma-separated | |
| aggregations | Yes | aggregations as name:op[:column], comma-separated | |
| partitionName | No | partition name (optional; defaults to the first partition) |