Forum Discussion
Clockwise
7 months agoHelper I
Conditional Formatting a Bar Chart using a measure
I am trying to simply add this conditional color to bar chart such that if it is more than average one color be used and if it is less than average another color. Take Red and Green. Here is the...
- 7 months ago
The soluton did not work exactly but were useful. I was able to resolve it in a differnet way. This can be closed.
cengizhanarslan
7 months agoSuper User
1) Total Past Due (measure)
Total Past Due :=
SUM ( 'Summary'[Total Past Due] )
2) Average Total Past Due (measure)
If you mean “average across categories currently shown”, do:
Avg Past Due (by category) =
AVERAGEX (
ALLSELECTED ( 'Summary'[Category] ), -- replace with your axis field
[Total Past Due]
)3) Color measure (return hex is safest)
Bar Color PastDue =
IF ( [Total Past Due] > [Avg Past Due (by category)], "#00B050", "#C00000" )
4) Apply it to the chart
Format pane → Data colors → fx
Format by: Field value
Based on field: Bar Color PastDue
Summarization: First
Now each bar should color based on whether it’s above/below the average.