add_svg_databar
Author an SVG data bar measure for Power BI that renders in-cell bars scaled to value/max, ideal for tables, matrices, and cards. Supports negative colors and left/right alignment.
Instructions
Author an SVG DATA BAR measure (DataCategory=ImageUrl) that renders an in-cell bar scaled to value/max. Drop it into a table/matrix/card. valueMeasure/maxMeasure are measure names; pass maxMeasure for a comparable scale. negativeFill colours bars below zero; align=left|right.
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>",
"name": "<name>",
"valueMeasure": "<valueMeasure>"
},
"name": "add_svg_databar"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | bar colour hex, e.g. #2E86AB | #2E86AB |
| name | Yes | the new measure's name | |
| align | No | left | right (right grows leftwards) | left |
| table | Yes | home table for the new measure | |
| width | No | svg width in px | |
| height | No | svg height in px | |
| sessionId | Yes | ||
| maxMeasure | No | a measure giving the bar's max/100% (optional - else |value|) | |
| negativeFill | No | colour for negative bars (optional) | |
| valueMeasure | Yes | the value measure, e.g. Total Sales |