Introduction
For this week’s Workout Wednesday challenge, we’re diving into a creative visual design trick that Fotiana Yan thinks you’re going to love trying out! (and I agree!)
Picture this: you have a stakeholder who wants sleek, colour-shifting progress rings for every country where they sell products to track progress toward a target, complete with a custom percentage label in the centre and a dynamic slider so they can tweak the target value on the fly.
However, they have one strict constraint. The solution cannot use custom visuals from AppSource due to organizational security policies and performance concerns.
To solve this, we are going to build the solution using inline SVG graphics in Power BI. This technique involves writing a DAX measure that generates dynamic SVG code based on the user-selected target, drawing custom progress rings that shift from red to yellow to green directly inside a standard Table visual. The result is a clean, fully interactive, app-like visual experience, with zero external downloads required.
A solution blog and file can be found ⬇️
Dataset
Data for this challenge can be obtained from GitHub.
https://github.com/Imba456/Workout-Wednesday-for-Power-BI/blob/main/datasets/Financial%20Sample.xlsx
Requirements
- Download the Excel file and connect the data into Power BI.
- Build a standard Table containing Country and a Total Sales Measure
- Create a numeric range parameter:
- range from $20M to $30M.
- $2M increments.
- Create a Measure that dynamically updates the SVG image of a Donut Chart (have a look at the hints below for more detail).
- Use the following SVG image code of a donut:
“data:image/svg+xml;utf8,
<svg xmlns=’http://www.w3.org/2000/svg’ viewBox=’0 0 100 100′>
<ellipse style=’paint-order: fill; fill: rgba(255, 255, 255, 0); stroke: rgb(234, 234, 234); stroke-width: 10px;’ cx=’50’ cy=’50’ rx=’40’ ry=’40’/>
<ellipse style=’fill: rgba(216, 216, 216, 0); stroke-width: 10px; stroke: rgb(6, 214, 160); stroke-linecap: round; transform-box: fill-box; transform-origin: 50% 50%;’ cx=’50’ cy=’50’ rx=’40’ ry=’40’ transform=’matrix(0, -1, 1, 0, 0, -0.000006)’/>
<text style=’fill: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 18px; text-anchor: middle; white-space: pre;’ x=’-15.506′ y=’-3.721′><tspan x=’52.51′ y=’67.405′ style=’baseline-shift: super; font-size: 18px; word-spacing: 0px;’>75%</tspan></text>
</svg>”
- Color the Donut based on the following logic and hexcodes:
- If Fill Percentage >= 100%: Emerald Green (#06D6A0)
- If Fill Percentage >= 75%: Amber Yellow (#FFD166)
- Anything below 75%: Coral Red (#FF6B6B)
- Geometry is hard… so here are some variables need to inserted in the SVG string (replacing fixed existing values such as the radius):
The variables should focus on:
VAR Radius = 40
VAR Circumference = 2 * 3.14159 * Radius
VAR DashArray = Circumference
VAR DashOffset = Circumference * (1–Pct)
- Fill Percentage: Calculates [Total Sales] / [Target Goal ($) value] (you need two variations of the percentage, one for the % text inside the ring and one for the length of the progress ring. Round to 1 decimal)
- If you want to create your own SVG image from scratch, follow the steps below:
- Create SVG image in https://boxy-svg.com/ (this will require creating a free account).
- Draw an ellipse shape and set dimensions in Geometry to center X: 50 and center Y: 50 with radius X: 40 and Radius Y: 40. Make sure the first ellipse has a grey stroke color (#EAEAEA).
- Repeat with the second ellipse shape and overlay on top of the first one. Make sure coordinates are matching and add a rotation of -90 degrees. Give it a different color to the first ellipse and change the cap setting to round.
- Add text to the centre of the ring and type 75% as a placeholder.
- Once you’re happy with the visual, hit File > Save and open the downloaded .svg file using a text editor app (Notepad).
- Create a canvas of w: 100 and h:100 with x and y set to 0 (in the Geometry panel.
- The progress ring is made up of two ellipse shapes with transparent fill and a thick stroke width (10px). Start with one at a time.
- Replace all double quotes (“) with single quotes(‘). This is the SVG code ready to use in your DAX measures!
Share
After you finish your workout, share on social media using the hashtags #WOW2026 and #PowerBI.
On Bluesky, tag @mmarie.bsky.social, @shan-gsd.bsky.social, and @merrykerry.bsky.social.
On LinkedIn, tag @FotianaYan and @RobbinVernooij