model_upsert_relationship
Create or update a table relationship in definition/relationships.tmdl. Define fact-to-dimension columns, cardinality, and filter direction to keep Power BI models consistent.
Instructions
Create or update a relationship between two tables in definition/relationships.tmdl.
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": {
"projectPath": "<projectPath>",
"fromTable": "<fromTable>",
"fromColumn": "<fromColumn>",
"toTable": "<toTable>",
"toColumn": "<toColumn>"
},
"name": "model_upsert_relationship"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toTable | Yes | One-side (dimension) table name | |
| isActive | No | Whether relationship is active (default: true) | |
| toColumn | Yes | One-side column name | |
| fromTable | Yes | Many-side (fact) table name | |
| fromColumn | Yes | Many-side column name | |
| projectPath | Yes | Path to the .pbip file or project root folder | |
| toCardinality | No | ||
| fromCardinality | No | ||
| crossFilteringBehavior | No | Cross-filter direction (default: oneDirection) |