Forum Discussion
Bar Chart Conditional Formatting
- 6 months ago
1) Create (or reuse) a measure for the value you’re grading
For a bar chart that’s using “Average of Score”, define it explicitly:
Avg Score = AVERAGE ( '2026 New Detail Table'[Score] )2) Use that measure in your color measure
Bar Color = VAR s = [Avg Score] RETURN SWITCH ( TRUE(), s <= 2, "#D32F2F", -- red s = 3, "#FBC02D", -- yellow "#388E3C" -- green )3) Apply it to the visual correctly
In the stacked bar chart:
Format → Data colors
Click fx
Format by: Field value
Based on field: Bar Color
Hi PPars2025 ,
Try to create (or use) a measure that aggregates Score, then use it for conditional formatting.
Avg Score =
AVERAGE ( '2026 New Detail Table'[Score] )
Use this measure for bar color
Bar Color =
SWITCH (
TRUE(),
[Avg Score] <= 2, "#D32F2F", -- Red (Needs Improvement)
[Avg Score] = 3, "#FBC02D", -- Yellow (Meets Expectations)
"#388E3C" -- Green (Exceeds Expectations)
)
If this response was helpful, please accept it as a solution and give kudos to support other community members
Regards,
Rufyda Rahma | MIE
- PPars20256 months agoHelper I
I am not sure I am following. Are you saying to use two measures?