add_rank_measure
Generate a DAX RANKX measure to rank a base measure by a dimension, with ISINSCOPE, ALLSELECTED, and blank guard, plus options for order, ties, and within-group ranking.
Instructions
Generate a RANKX measure with ISINSCOPE + ALLSELECTED + blank guard. order = ASC | DESC (default DESC); ties = SKIP | DENSE (default SKIP). withinGroup (Table[Column]) ranks inside each group.
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>",
"baseMeasure": "<baseMeasure>",
"dimension": "<dimension>"
},
"name": "add_rank_measure"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ties | No | SKIP | DENSE (default SKIP) | SKIP |
| order | No | ASC | DESC (default DESC) | DESC |
| table | Yes | home table | |
| dimension | Yes | dimension column as Table[Column] | |
| sessionId | Yes | ||
| baseMeasure | Yes | base measure name | |
| withinGroup | No | group column as Table[Column] for within-group ranking (optional) |