Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Custom Data Colors using Function

Hello,   I am trying to set custom Data Colors for a bar graph based on their values. I would like to visual to show something like this, i.e. all values < 25% to be green,>= 25% to be amber and >...
  • amitchandak's avatar
    amitchandak
    4 years ago

    Anonymous , Try to create a measure like 

     

    Color =

    Var _1 = [sum of BM Quantity] // make sure this the ratio measure 

    Switch( true() ,

    _1< =.25, "green",

    _1< =.75, "yellow",

    "Red"

    )

     

    Use in conditional formatting using field value option

    How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

     

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi, Anonymous 

    Here you should use 'value' instead of 'percent'. Percent in conditional formatting refers to the percentage of all data distributions. Please refer to this document for details.

     

    You can also refer to my sample file:

    Best Regards,
    Community Support Team _ Eason