Skip to content
Development
Skill

/svg-visuals

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

From plugin
power-bi-agentic-development
1.1k35 skills8 agents2 commands1 MCP

Claude Code

$ npx -y skills add data-goblin/power-bi-agentic-development --skill svg-visuals --agent claude-code

SKILL.md

svg-visuals.SKILL.md
name: svg-visuals
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).

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:

1. **Query the model first** -- use DAX Studio or Tabular Editor CLI to get actual values with the intended filter context. Use real numbers, not placeholders. 2. **Write static SVG to a temp file** -- save to `/tmp/mockup.svg` and `open` it in a browser to preview layout, colors, and proportions. 3. **Ask for feedback** before converting to DAX -- iterating on static SVG is far easier than on DAX string concatenation. 4. **Colors must be hex codes with `#`** -- e.g., `fill='#2B7A78'`. Never use `%23` URL encoding or named colors. Always hex.

Step 1: Create the Extension Measure

Create the extension measure in `reportExtensions.json` manually (see the `pbir-format` skill in the pbip plugin for JSON structure).

# Example using pbir_object_model (if available):
report.add_extension_measure(
    table="Orders",
    name="Sparkline SVG",
    expression='''
        VAR _Prefix = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'>"
        VAR _Bar = "<rect x='0' y='0' width='50' height='30' fill='#2196F3'/>"
        VAR _Suffix = "</svg>"
        RETURN _Prefix & _Bar & _Suffix
    ''',
    data_type="Text",
    data_category="ImageUrl",
    display_folder="SVG Charts",
)
report.save()

Step 1b: Review

Before presenting the measure to the user, dispatch the `svg-reviewer` agent to validate syntax and provide design feedback.

Step 2: Bind to a Visual

Extension measures use `"Schema": "extension"` in the SourceRef:

{
  "field": {
    "Measure": {
      "Expression": {
        "SourceRef": {"Schema": "extension", "Entity": "Orders"}
      },
      "Property": "Sparkline SVG"
    }
  }
}

For **image visuals**, bind the SVG measure through `pbir add visual image --image`; see `references/svg-image-visual.md`.

Step 3: Validate

Validate with `pbir validate "Report.Report" --all` and inspect bindings with `pbir visuals bind "...Visual" --show`.

Prefer UDF Libraries Over Custom DAX

Before writing a custom SVG measure from scratch, check whether an existing UDF library already provides the chart type:

  • **PowerofBI.IBCS** (Andrzej Leszkiewicz) -- IBCS-compliant bar, column, waterfall, pin, small multiples, and P&L charts. Preferred for business reporting with AC/PY/BU/FC comparisons. Install from https://daxlib.org/package/PowerofBI.IBCS/
  • **DaxLib.SVG** (Jake Duddy) -- general-purpose sparklines, bars, boxplots, heatmaps, jitter, violin, progress bars, pills. Install from https://daxlib.org/package/DaxLib.SVG/ -- source at https://github.com/daxlib/dev-daxlib-svg
  • **PowerBI MacGuyver Toolbox** (Stepan Resl / Data Goblins) -- C# scripts that generate SVG measures via Tabular Editor

To check if a library is installed, look for functions/measures starting with `PowerofBI.IBCS.`, `Viz.`, `Compound.`, or `Element.`. Only write custom SVG DAX when no library function covers the required visualization. See `references/community-examples.md` for full function listings and additional libraries.

Installing UDF libraries

UDF libraries are installed into the semantic model, not the report. Use one of these tools:

  • **Tabular Editor CLI** (`te` command) -- use the `te-docs` skill for guidance
  • **Power BI MCP server** -- if available, use it to modify the model directly
  • **`connect-pbid` skill** -- connect to Power BI Desktop's local Analysis Services instance via TOM/PowerShell
  • **`tmd
Read more
@data-goblin
Ships withpower-bi-agentic-development

Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports, and AI dashboards. Includes Microsoft Fabric skills and Fabric agents. Weekly updates.

1.1k35 skills8 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of data-goblin/power-bi-agentic-development on GitHub, a chart by star-history.com

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about svg-visuals.

Which coding agents can use svg-visuals?
svg-visuals installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.