set_data_bars
Apply data bars to a measure in Power BI visuals, turning values into in-cell bars with customizable colors, direction, and axis. Set min/max for controlled scaling.
Instructions
Add DATA BARS to a measure column in a table/matrix: an in-cell bar whose length tracks the measure, with a positive colour and an optional negative colour. reverseDirection draws bars right-to-left; hideText shows the bar only (no value text); axisColor sets the zero-axis colour; minValue/maxValue pin the bar scale (omit for auto - the default fixes the old min==max bug where bars never rendered). Verify the render in Desktop.
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>",
"visual": "<visual>",
"measureTable": "<measureTable>",
"measure": "<measure>",
"positiveColor": "<positiveColor>"
},
"name": "set_data_bars"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | page name or displayName | |
| visual | Yes | table/matrix visual name | |
| measure | Yes | measure that drives the bars | |
| hideText | No | show the bar only, hide the value text | |
| maxValue | No | explicit maximum bar value (omit for auto) | |
| minValue | No | explicit minimum bar value (omit for auto) | |
| axisColor | No | zero-axis colour hex (default #000000) | |
| measureTable | Yes | table that owns the measure | |
| negativeColor | No | optional negative bar colour hex e.g. #E81123 | |
| positiveColor | Yes | positive bar colour hex e.g. #1B8A4B | |
| reportSessionId | Yes | ||
| reverseDirection | No | draw bars right-to-left |