Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Conditional Formatting - measures not available

I want to color brands based on Profit by Year.

ProfitLastYear = 
var NumbDays = 
    if(
        TODAY() - FIRSTNONBLANK(Verkoopslijnen[Datum], 1) <= 365
        , TODAY() - FIRSTNONBLANK(Verkoopslijnen[Datum], 1)
        , 365
    )

RETURN
   DIVIDE(
        CALCULATE(
            SUM(Verkoopslijnen[Winst])
            , Kalender[Date] >= TODAY() - NumbDays
        )
        , NumbDays
   )

Second Measure is:

ColorPicker = 
SWITCH(
    TRUE()
    , [ProfitLastYear] < 5, "#00FF00"
    , [ProfitLastYear] < 100, "#FFFF00"
    , [ProfitLastYear] <10000, "#FF0000"
    , "#C0C0C0"
)

Now, I want to use the ColorPicker as conditional Format on my brands, but I cannot click on the measures

What Am I doing wrong?

4 Replies