Forum Discussion
third_hicana
Helper IV
2 years agoConditional Formatting- Background color based on comparing the values of multiple columns
Hi. I just want to ask for help on how to create a measure to format the background color based on the lowest to the highest value of multiple columns. Thank you for your help
v-weiyan1-msft
Community Support
2 years agoHi third_hicana ,
I am not sure if I understood your question correctly.
Based on your description and my understanding, I used the following data sample.
Please refer to the following steps:
1.Please try code as below to Create a Calcualted table.
Table 2 = DATATABLE(
"ColumnName",STRING,
"Order",INTEGER,
{
{"Est. FTE Q1",1},
{"Est. FTE Q2",2},
{"Est. FTE Q3",3},
{"Est. FTE Q4",4},
{"Est. FTE for Initiative Duration",5}
}
)
2. Use the following code to create a Measure.
Measure =
VAR Q1 = SELECTEDVALUE('Table'[Est. FTE Q1])
VAR Q2 = SELECTEDVALUE('Table'[Est. FTE Q2])
VAR Q3 = SELECTEDVALUE('Table'[Est. FTE Q3])
VAR Q4 = SELECTEDVALUE('Table'[Est. FTE Q4])
VAR Initiative_Duration = SELECTEDVALUE('Table'[Est. FTE for Initiative Duration])
RETURN
SWITCH(
MAX('Table 2'[ColumnName]),
"Est. FTE Q1",Q1,
"Est. FTE Q2",Q2,
"Est. FTE Q3",Q3,
"Est. FTE Q4",Q4,
"Est. FTE for Initiative Duration",Initiative_Duration
)
3.The fields in the visual object are as follows, right-click "Measure" and select "Conditional Formatting". Then do the following.
Result is as below.
Please correct me if I misunderstood your needs.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.