Change bar colors


I want the below colors for the bars on the basis of score percentage’s average… how do I do it. I wen t through some questions but i am unable to implement.
ifelse({Score (Percentage)} <= 0.19, “Red”, ifelse({Score (Percentage)}<=0.34, “Orange”, ifelse({Score (Percentage)}<=0.49, “Yellow”, ifelse({Score (Percentage)}<=0.74, “Light Green”, ifelse({Score (Percentage)}<= 0.89, “Green”, “Dark Green”)))))

@Bushra_BV

Welcome to the community.

Please use the below reference link and let us know if it helps.

https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Visual-Bar-Conditional-Formatting

Regards,
Pradeep S

1 Like

Nothing is working for me. Using avg() in the query is not letting me add it in the colors section. example - below -ifelse(avg({Score (Percentage)}) <= 0.19, 1, ifelse(avg({Score (Percentage)})<=0.34, 2, ifelse(avg({Score (Percentage)})<=0.49, 3, ifelse(avg({Score (Percentage)})<=0.74, 4, ifelse(avg({Score (Percentage)})<= 0.89, 5,6)))))

Also, if I dont keep avg() then the output looks something like this-

Please help formulating the query

1 Like

Hi @Bushra_BV,
Using a calculated field to set visual colors is a limitation within Quick Sight. What you’re trying to setup is conditional formatting, which is unavailable on a number of visual types as they only allow you to alter the colors based on field values that exist in your dataset.

While the visual appeal would be much different, to have a color scale that honors your conditional formatting, you could use a table and setup that format (then you could expand the column to imitate a bar graph).

I’ll mark this as a feature request as well to provide additional visibility to our support team.

Let us know if you have any additional questions!

Hi @Bushra_BV,
Since we haven’t heard back and I’ve set this as a feature request, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!