Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Icons Color formatting

The new July 2019 release has this amazing feature where we can use icons directly in tables and matrix based on the column values. However i'm struggling a bit with the colors in those icons. 

 

Is there a way to change the colors of those icons in the table? 

 

Ex : Check mark in green circle is a good icon for KPI in table. But i want a darker green shade. Is it possible?

Note : I'm using SSAS tabular as backend source, so can't use unichars (for conditional formatting using DAX) and can't use advanced editor.

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi SBELANIX,

You could try to create measure to define icon color like below

Measure 2 = 
SWITCH (
    TRUE (),
    [Measure] < 0.2, "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40'  stroke='purple' stroke-width='4' fill='purple' /> </svg>",
  [Measure] < 0.4, "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='4' fill='dark green' />
</svg>",
    "https://i.gifer.com/4Ym4.gif"
   --  "https://i.gifer.com/Omjx.gif"
)

Then use this in conditional format like below

118.PNG121.png

You could refer to Conditional Formatting Using Icons In Power BI for details

 

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi SBELANIX,

You could try to create measure to define icon color like below

Measure 2 = 
SWITCH (
    TRUE (),
    [Measure] < 0.2, "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40'  stroke='purple' stroke-width='4' fill='purple' /> </svg>",
  [Measure] < 0.4, "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='4' fill='dark green' />
</svg>",
    "https://i.gifer.com/4Ym4.gif"
   --  "https://i.gifer.com/Omjx.gif"
)

Then use this in conditional format like below

118.PNG121.png

You could refer to Conditional Formatting Using Icons In Power BI for details

 

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is another case in PBI where the solution that should be out of the box, and/or easy to implement requires an incredibly complex DAX expression.  Why does everything in PBI require the most over engineered solution for the most simple and minor ask?

Anonymous
Not applicable

Well actually the field value on conditional formatting doesn't work while connecting through SSAS cubes. But found a solution in the link you shared. We can change the color codes from JSON files. Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.