Forum Discussion

jstanley1017's avatar
jstanley1017
Frequent Visitor
1 year ago
Solved

cell formatting in matrix based on row/column - error assigning measure to conditional formatting

I would like to assign conditional formatting to a matrix based on row/column values.     I have created a measure called color to use for this conditional formatting.   color = var row_...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi jstanley1017 ,

    Please refer to the following steps.

    The measure is as follows.

     

     

     

    color = 
     var row_selection = (SELECTEDVALUE(Tiering[Tier],1))
     VAR column_selection = SELECTEDVALUE(Res[Resiliency],1)
    RETURN
    SWITCH(TRUE(),
        column_selection IN {"AA","RR"},"Green",
        column_selection="AS",IF(row_selection IN{"Tier 1","Tier 2"},"Yellow","#CCFF66"),
        column_selection="AP",IF(row_selection IN{"Tier 1","Tier 2","Tier 3"},"Yellow","#CCFF66"),
        column_selection="ND",IF(row_selection IN {"Tier 1","Tier 2","Tier 3", "Tier 4" },"Red",
                                    IF(row_selection = "Tier 5","Gray","#FFFFFF")
                                    ),
        "#FFFFFF"
    )

     

    Use the measure as the background formatting for the matrix values. And the final result is as follows.


    Please see the attached pbix for reference.

    Best Regards,
    Dengliang Li

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