Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
So I have a table of KPI value, all values shown below are the average of the result. For my target calculation I have a switch case as such:
Targets =
SWITCH(
TRUE(),
'Table'[MetricName] = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red",
'Table'[MetricName] = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red",
"Green"
)
Targets is a calculated column. In this program I am saying if the average result of a specific column name is greater than 10 then it is red if not it is green. Why does it show green for all values? I have tried it with and without the average around result.
Solved! Go to Solution.
Hi @Anonymous ,
According to your code, I think [Target] is a calculated column. Here I suggest you to create a measure instead of calcualted column for conditional formatting. And there are not many conditions and return values in parallel here, only green and red. So I suggest you to try IF function.
My Sample:
Measure:
Targets =
IF (
MAX ( 'Table'[MetricName] ) = "Days to Containment"
&& AVERAGE ( 'Table'[Result] ) > 10,
"Red",
"Green"
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your code, I think [Target] is a calculated column. Here I suggest you to create a measure instead of calcualted column for conditional formatting. And there are not many conditions and return values in parallel here, only green and red. So I suggest you to try IF function.
My Sample:
Measure:
Targets =
IF (
MAX ( 'Table'[MetricName] ) = "Days to Containment"
&& AVERAGE ( 'Table'[Result] ) > 10,
"Red",
"Green"
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 10 | |
| 10 | |
| 4 | |
| 3 | |
| 3 |