Custom icons in Power BI tables: conditional formatting with your own icons
A small arrow next to a number tells the story faster than the number itself: up and green, down and red. Power BI has this built in, but with only a few icon sets. With one DAX measure you can use any icon, in your own colors.
Built-in icons: quick, but limited
Select a table or matrix, open Format → Cell elements, choose the column and turn on Icons. You set rules (for example, value greater than 0 gets a green arrow) and pick an icon style. It works, but you can only choose from Power BI's own sets of arrows, traffic lights and flags, and their colors do not follow your theme.
Your own icons with a DAX measure
The idea: a measure checks the value and returns a different SVG icon for each case. Power BI shows the result as an image.
Change icon =
VAR v = [Revenue change %]
VAR good = "%232E9E6A"
VAR bad = "%23D64545"
VAR neutral = "%238F98A9"
VAR up = "<path d='M4 17l6-6 4 4 6-6' stroke='" & good & "'/>"
VAR down = "<path d='M4 7l6 6 4-4 6 6' stroke='" & bad & "'/>"
VAR flat = "<path d='M4 12h16' stroke='" & neutral & "'/>"
RETURN
"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>" &
SWITCH(TRUE(), ISBLANK(v), "", v > 0, up, v < 0, down, flat) &
"</svg>"
- Replace
[Revenue change %]with your own measure, a number that can be positive or negative. - In Measure tools → Data category choose Image URL.
- Put the measure in the table next to the value it follows. Set the size under Format → Image size; 16 to 20 px usually fits the row height.
Tips
- Colors from the theme. Use the theme's good, bad and neutral colors so the icons match the conditional colors in charts. Write
#as%23inside the SVG. - Think about which direction is good. For costs or days late, a decrease is good. Swap the colors for those measures, not the arrows.
- Thresholds instead of zero. If small changes do not matter, use for example
v > 0.02andv < -0.02, and show a flat line in between. - Do not rely on color alone. Different shapes (up, down, flat) help people who do not see red and green well.
- Same icon in a card. The new card visual can show an image from a field, so the same measure works in KPI cards.
Without writing the DAX by hand
In Temat Studio under Icons → KPI icon, enter the name of your measure, pick the icon shape and the app writes the whole measure with your theme's good, bad and neutral colors. Copy it, paste it as a new measure, set the data category to Image URL, and it is done. For static icons, see how to add icons to a Power BI report.
Try it in Temat Studio
Free, no account, runs in your browser.
All guides
- How to create a dark theme in Power BI
- Power BI theme JSON explained
- How to use your company colors in Power BI
- Why your Power BI theme doesn't change every visual
- Why your Power BI theme doesn't change SVG and custom visuals
- How to add icons to a Power BI report
- How to share a Power BI theme with your team