Forum Discussion

uvil's avatar
uvil
Resolver I
7 years ago
Solved

Conditional formatting with filters

Hey all,   I have a Matrix table formed by different zone Groups, that have different % objectives, and when I apply a Conditional Formatting to the table I can't give them different values dependi...
  • Vvelarde's avatar
    Vvelarde
    7 years ago

    uvil

     

    Hi, try with this:

     

    A measure to apply the color :

     

    Color =
    VAR _Sales =
        SUM ( Sales[Sales] )
    VAR _Group =
        SELECTEDVALUE ( Sales[Group] )
    RETURN
        SWITCH (
            _Group,
            "Group 1", SWITCH (
                TRUE (),
                _Sales <= 0,18, "#ff0000",
                _Sales < 0,21, "#ffa500",
                "#00ff00"
            ),
            "Group 2", SWITCH (
                TRUE (),
                _Sales <= 0,14, "#ff0000",
                _Sales < 0,18, "#ffa500",
                "#00ff00"
            ),
            "Group 3", SWITCH (
                TRUE (),
                _Sales <= 0,24, "#ff0000",
                _Sales < 0,28, "#ffa500",
                "#00ff00"
            )
        )
    

    Note: You can improve this if work with a table and the range color by each group.

     

     

    Finally , in conditional format Select Format by Field Value and choose the measure (In this case Color)

     

    Ready

     

    Victor