Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
evadung
Frequent Visitor

Color if value is above/under average

Hello, 
I have this graph, each day is sums of values. I want to color red/green if daily sum of values is above average of all days sum (4 608,9 Kč) or under. That means day 1, 2, 6 and 7 should be green and day 3 red. I tried to this DAX: 

Color =
VAR _AVERAGE = AVERAGEX (
    SUMMARIZE ( Dotaz, Dotaz[Date]),
    CALCULATE ( SUM (Dotaz[Value]) )
)
RETURN
IF(SUM(Dotaz[Value])>_AVERAGE,"Green","Red")

But it does not work. Any ideas?
 
dd.png
1 REPLY 1
eliasayyy
Memorable Member
Memorable Member

hello beore anything you have to test to se ewhat the measure returns, so instead of returning color, try returning the average measure, if the measure is calclating correctly then let me know and if the measure is incorrect value, then you have your answer an dneed to fix the average measure

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.