top of page
Search

⚡One UDF to Build All Your SVG Pills in Power BI

A flexible, scalable way to generate beautiful SVG pills for statuses, priorities, and tags using Power BI’s new User-Defined Functions.


ree

PBIX available at the end of this article 🎉!


Introduction

Power BI’s new User-Defined Functions (UDFs) have opened up a whole new way to streamline and accelerate both team and individual report development. As I start to integrate them into more and more projects, some patterns are clearly emerging: a few UDFs end up being reused everywhere.

One of the use cases I keep coming back to is SVG status pills for table visuals.These tags can show up in almost every report:

  • task status (Not started / In progress / Completed)

  • project health (On track / At risk)

  • departments or categories (Design / Development / Marketing)


The data fields change from project to project, but the visual style is almost always the same.


Here is a short demo: 


In this article, I’ll share the UDF I now use to generate these SVG pills, and show how you can plug it into different measures (status, priority, etc.) across multiple reports. Examples of these pills are shown in the Priority and Status fields of the table visual of this cover image. They both use the same UDF. 



 
 
 
bottom of page