Forum Discussion

josephliverpool's avatar
josephliverpool
Frequent Visitor
2 years ago
Solved

New Card - Conditional Formatting the Detail Label Which Contains a Measure

Hi!

 

I have the following measure in the detail tab on the new card visual. This works fine and displays a black arrow showing up or down but how do I change the colour of the arrow to show as green when up or red when down? I've tried conditional formatting but absoutely no joy at all!

 

Problems Raised  =
VAR Up_Arrow = UNICHAR(129137)
VAR Down_Arrow = UNICHAR(129139)
VAR lastmonth = [Problems Closed in Previous Month]
VAR total = [Total Number of Problems Closed]


RETURN
IF(total > lastmonth,Up_Arrow,Down_Arrow)
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi josephliverpool 

    After testing, in card cannot set the icon color, you can consider to use the kpi visual.

    put the [Total Number of Problems Closed] measure to the value, then put the [Problems Closed in Previous Month] to the target, in trend axis, you can put year or other field.

    Then when filter the slicer, you can refet to the following picture.

     

    Best Regards!

    Yolo Zhu

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

2 Replies

  • Ramya_Shree's avatar
    Ramya_Shree
    Regular Visitor

    To change the arrow color in your New Card visual

    You can add HTML formatting to your measure to control the color directly

    Problems Raised =
    VAR Up_Arrow = "<span style='color:green'>" & UNICHAR(129137) & "</span>"
    VAR Down_Arrow = "<span style='color:red'>" & UNICHAR(129139) & "</span>"
    VAR lastmonth = [Problems Closed in Previous Month]
    VAR total = [Total Number of Problems Closed]

    RETURN
    IF(total > lastmonth, Up_Arrow, Down_Arrow)

    or  Alternatively, create two separate measures—one for color and one for the arrow—and then use conditional formatting based on the color measure in the New Card visual.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi josephliverpool 

    After testing, in card cannot set the icon color, you can consider to use the kpi visual.

    put the [Total Number of Problems Closed] measure to the value, then put the [Problems Closed in Previous Month] to the target, in trend axis, you can put year or other field.

    Then when filter the slicer, you can refet to the following picture.

     

    Best Regards!

    Yolo Zhu

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