set_button_state_cf
Set button state colors in Power BI using a measure that returns hex values, applying to fill, text, or icon for default, hover, pressed, or selected states.
Instructions
Measure-driven per-STATE button formatting: a measure returning a hex colour drives a button's fill/text/icon colour for a given state. state=default|hover|pressed|selected; target=fill|text|icon. button is the actionButton's visual name. colorMeasure = "Table[Measure]".
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": {
"reportSessionId": "<reportSessionId>",
"page": "<page>",
"button": "<button>",
"colorMeasure": "<colorMeasure>"
},
"name": "set_button_state_cf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | page name or displayName | |
| state | No | default | hover | pressed | selected | default |
| button | Yes | the button visual name | |
| target | No | fill | text | icon | fill |
| colorMeasure | Yes | the colour measure, "Table[Measure]" | |
| reportSessionId | Yes | ||
| colorMeasureTable | No | the measure's table (if not embedded in colorMeasure) |