If you’ve ever stacked three KPI cards down the side of a Power BI report just to show Sales, Quantity, and Unique Products, this trick is for you.
We’re going to build one KPI card that switches between metrics when the user clicks a button. No custom visual, no marketplace plugin — just DAX and a bit of SVG.

How to build it? (5 steps)
Step 1 — Build your base measures
Create TY and LY pairs for every metric you want to switch between. Example:
Total Sales/Total Sales LYTotal Quantity Sold/Total Quantity Sold LYTotal Unique Products/Total Unique Products LY
Step 2 — Create a field parameter
Go to Modeling → New parameter → Fields and add the TY measures. Power BI auto-creates a Parameter table with a Parameter Order column (0, 1, 2…) — that’s the index we’ll use to switch.
Step 3 — Drop a button slicer
Add a Slicer visual, set it to Tile layout, and put the Parameter field in it. Clicking a button filters the parameter table to one row.
Step 4 — Write the SVG measure
Create a measure that reads Parameter[Parameter Order], picks the right TY/LY pair via SWITCH, formats the values, and returns an SVG string prefixed with data:image/svg+xml;utf8,. Color the variance green or red based on sign — that gives the card its “smart” feel.
Step 5 — Render it as an Image
Drop an Image visual on the report, drag the measure into the URL field, and in the model view set the measure’s Data category to Image URL. Done — click a slicer button and the card swaps.
That’s it. Five steps, no custom visual, fully native Power BI.
Try it yourself
I’ve put the full DAX measure, a README with the step-by-step, and a preview screenshot on GitHub. Clone it, paste the measure into your model, and you’re up:
Want to actually land a data job?
If you’re learning Power BI because you want a job in data — read this next bit.
I built FirstDataJob.com for exactly that. It’s the resource I wish I’d had when I was breaking into the field:
Resume reviews built for data roles — not generic templates. We look at how you frame your projects, your tools, and your impact metrics so recruiters actually call back.
Curated job listings — analyst, BI developer, data engineer roles, filtered for actual entry- and mid-level openings (not the “entry-level, 5 years required” trap).
Upskilling tracks — Power BI, SQL, Python, and DAX paths that map to what hiring managers test for, not what looks good on a course catalog.
If a clickable KPI card felt approachable, the rest of the journey can too. Start at FirstDataJob.com.
Subscribe — I help you learn new Data Concept every week!