Forum Discussion

evadung's avatar
evadung
Frequent Visitor
2 years ago

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?
 

1 Reply

  • eliasayyy's avatar
    eliasayyy
    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