Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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.    I...
  • dax's avatar
    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&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

    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.