Forum Discussion

Jaqinthebox's avatar
Jaqinthebox
Regular Visitor
2 years ago
Solved

Conditional formatting using a measure

Hi,   How can I have different colours for different years in a chart visual? I have tried a switch measure but when I go to the Conditional formatting option on the visual, the measure I just made...
  • Jihwan_Kim's avatar
    2 years ago

    Hi,

    I am not sure how your semantic model looks like, but if the year column in the calendar table is not text format, please try something like below.

     

    Colour scheme =
    SWITCH (
        TRUE (),
        MAX ( 'Calendar'[Year] ) = 2022, "pink",
        MAX ( 'Calendar'[Year] ) = 2023, "purple",
        MAX ( 'Calendar'[Year] ) = 2024, "orange",
        "silver"
    )