# SVG Visuals

SVG generation via DAX measures and extension measures with ImageUrl data category for...

- Repository: https://github.com/data-goblin/power-bi-agentic-development (1079 stars)
- Category: Engineering
- License: GPL-3.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add data-goblin/power-bi-agentic-development --skill svg-visuals -g -a claude-code -y`
Codex: `npx skills add data-goblin/power-bi-agentic-development --skill svg-visuals -g -a codex -y`
Cursor: `npx skills add data-goblin/power-bi-agentic-development --skill svg-visuals -g -a cursor -y`
Gemini CLI: `npx skills add data-goblin/power-bi-agentic-development --skill svg-visuals -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add data-goblin/power-bi-agentic-development`

## Description

SVG generation via DAX measures and extension measures with ImageUrl data category for inline visualizations in PBIR reports, including ready templates for matrix and table cells, new card images and per-button images on the new button slicer. Automatically invoke when the user mentions "SVG visual", "DAX sparkline", "SVG measure", "inline graphics with DAX", "ImageUrl data category", "extension measure", or asks to create any DAX-generated chart (progress bars, bullet charts, KPI indicators, data bars, gauges, donut charts, lollipop charts, dumbbell charts, status pills, overlapping bars, boxplots, IBCS bars, jitter plots, box-and-whisker charts).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# SVG Visuals via DAX Measures (PBIR)

> **Use `pbir` for every report mutation.** The `pbir-format` skill is read-only schema context.
> If the CLI is unavailable or lacks an operation, stop and report the gap.

Generate inline SVG graphics using DAX measures that return SVG markup strings. These render as images in table, matrix, card, image, and slicer visuals. Store as extension measures in `reportExtensions.json`.

## How It Works

1. A DAX measure returns an SVG string prefixed with `data:image/svg+xml;utf8,`
2. The measure's `dataCategory` is set to `ImageUrl`
3. Power BI renders the SVG as an image in supported visuals

## Supported Visuals

- Table (`tableEx`): `grid.imageHeight` / `grid.imageWidth` -- `references/svg-table-matrix.md`
- Matrix (`pivotTable`): same as table -- `references/svg-table-matrix.md`
- Image (`image`): `sourceType='imageData'` + `sourceField` -- `references/svg-image-visual.md`
- Card/New (`cardVisual`): the `image` object (image area) or `cardImage` (callout image) -- `references/svg-template-matrix.md`, patterns in `references/svg-card-slicer.md`
- Slicer/New (`advancedSlicerVisual`): one image per button through the image "Select from data" slot -- `references/svg-template-matrix.md`

## Start From a Template

Before writing DAX by hand, check `references/svg-template-matrix.md`: it maps each pattern (bullet, progress, pill, sparkline, dumbbell, diverging, delta, pin, gauge) to the hosts it fits (an SVG on its own goes in an image visual, a card is for a number), shows the verified PBIR wiring per host, and gives the one-step `pbir visuals svg` / `pbir add gauge-card` commands that write the pattern as a thin report measure and wire it in. Hand-write SVG DAX only for a shape no template covers.

## Workflow: Creating an SVG Measure

### Step 0: Design and Preview

Before writing DAX, design the SVG visually:

The rest: https://github.com/data-goblin/power-bi-agentic-development/blob/HEAD/plugins/custom-visuals/skills/svg-visuals/SKILL.md
