Forum Discussion
Icons Color formatting
- 7 years ago
Hi SBELANIX,
You could try to create measure to define icon color like below
Measure 2 = SWITCH ( TRUE (), [Measure] < 0.2, "data: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: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
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.
Hi SBELANIX,
You could try to create measure to define icon color like below
Measure 2 =
SWITCH (
TRUE (),
[Measure] < 0.2, "data: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: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
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?