Forum Discussion

HamidBee's avatar
HamidBee
Power Participant
4 years ago
Solved

How do I create a Colour Measure for each column?

I plan to to create multiple bar charts. I am going to create a custom formating for the data colours. I created a measure called 'colours' that makes the bar green if it is less than 5 and red if it...
  • v-yanjiang-msft's avatar
    v-yanjiang-msft
    4 years ago

    Hi HamidBee ,

    According to your latest file, here's my solution.

    1.Create the color measure.

     

    Colour = 
    SWITCH (
        MAX ( '2021'[Letter] ),
        "A", IF ( MAX ( '2021'[Value] ) > 10, "Purple", "Green" ),
        "B", IF ( MAX ( '2021'[Value] ) > 10, "Blue", "Green" ),
        "C", IF ( MAX ( '2021'[Value] ) > 10, "Red", "Green" ),
        "D", IF ( MAX ( '2021'[Value] ) > 10, "Orange", "Green" ),
        "E", IF ( MAX ( '2021'[Value] ) > 10, "Purple", "Green" )
    )
    

     

    2.For visual A, put Dates in Axis, Value in Values and put Letter in the vasual filter, then selete Letter is A. For visual B, select Letter is B, and so on.

     

     

    3.For each visual, use the color measure for data color, get the expected result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.