Forum Discussion
PPars2025
6 months agoHelper I
Bar Chart Conditional Formatting
I'm using the Stacked Bar Chart to display the grading of my field audits and want to apply color conditional formating but I am needing a measure. I've tried the below DAX but it won't reference th...
- 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
cengizhanarslan
6 months agoSuper User
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
- PPars20256 months agoHelper I
Thank you! Can you explain where to findthe following? I am not seeing data colors within the forman pane options:
Format → Data colors