refactor_to_calculation_groups
Consolidate repetitive DAX measures like YTD, QTD, and PY into calculation groups to reduce model complexity and standardize time intelligence.
Instructions
Consolidate repetitive measures (e.g. YTD, QTD, PY) into calculation groups.
Use this tool when the user asks to:
Refactor or clean up redundant DAX measures using calculation groups.
Reduce model complexity and standardize time intelligence calculations.
Args: target: Target PBIP directory or TMDL path. min_candidates: Minimum measure patterns needed to trigger consolidation. reconcile_strategy: "strict" or "lenient". preserve_originals: Whether to keep original measures alongside the calculation group. auto_apply: If True, write calculation items immediately; if False, return proposed refactoring plan. inspector: Optional model inspector. measure_writer: Optional measure writer callable.
Returns: Dict with proposed or applied calculation items, candidate measures, and impact assessment.
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": {
"target": "<target>"
},
"name": "refactor_to_calculation_groups"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| inspector | No | ||
| auto_apply | No | ||
| measure_writer | No | ||
| min_candidates | No | ||
| preserve_originals | No | ||
| reconcile_strategy | No | strict |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||