DAX patterns

Power BI SVG measures

A DAX measure can return a picture: text starting with data:image/svg+xml, set to the Image URL data category. These 17 patterns cover the charts people most often squeeze into a table cell or a card, each with the full DAX, a preview rendered from that DAX, and the gotchas.

By · Founder & Reliability Engineer · Updated

Trend

Progress to target

Status

Comparison

Composition

KPI card

Scalar, series and scaled measures

The pattern's shape decides where it can go and what it costs to evaluate.

SVG measure shapes and where they work
ShapeHow it's computedWhere it works
ScalarOne value per row (or per card): progress bar, ring, bullet, RAG, delta badge, pill, stars, icon, donut. Cheapest to evaluate.Table, matrix, new Card visual (image or callout image)
SeriesIterates an axis with CONCATENATEX to draw a trend inside each row: sparklines, column sparkline, win/loss, KPI card.Table or matrix with a category on rows; Card visual (whole trend)
ScaledReads every visible row once (ALLSELECTED over the row column) so all rows share a scale: data bars, variance bars, dumbbells.Table or matrix, with the named column on rows

When an SVG measure isn't enough

Questions

Are SVG measures supported by Microsoft?

Image URL is a documented data category, and Microsoft Learn's own Card visual tutorial builds SVG images with DAX measures and a user-defined function. The SVG markup inside is yours, so test it like any other measure.

Should I use the built-in sparklines or an SVG measure?

Built-in table sparklines need no DAX and are the simplest choice for a plain line or column trend. Choose an SVG measure when you need markers, targets, thresholds, colours by direction, or the same picture in a Card visual.

Do SVG measures slow reports down?

Each one is a measure evaluated per visible row, and series patterns also iterate the axis. A dozen periods across a screen of rows is fine; thousands of rows with three-year daily series is not. Filter or TOPN the table, and coarsen the axis.