cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JOctavio
Frequent Visitor

BACKGROUND COLOR WHEN FILTERING

Hi everyone !

 

I have a dashboard with some filters that modify a table. I would like to update the background color on a column while applying filters.

Is it possible to update the values of the rules for the background color (conditional formatting) while applying the desired filters? Is it possible to do it interactively or the limit values are static?

2 ACCEPTED SOLUTIONS

Thank you so much but I wonder if it is possible to modify dinamically the background colour using rules based on numeric values. Is it possible to change those values while applying filters?forum.PNG

View solution in original post

Hi, @JOctavio 

 

You can try the following methods.

Color Measure = 
Var _value=SUM('Table'[Value])
Return
SWITCH(TRUE(),
_value>=0&&_value<=33,"Green",
_value>=34&&_value<=66,"Orange",
_value>=67&&_value<=100,"Red")

vzhangti_0-1673862047338.png

Result:

vzhangti_1-1673862065328.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @JOctavio 

 

You can try the following methods.

Sample data:

vzhangti_0-1672728412372.png

Table:

Slicer = VALUES('Table'[Type])

vzhangti_1-1672728479477.png

vzhangti_5-1672728624494.png

Color Measure = SWITCH(TRUE(),
SELECTEDVALUE('Slicer'[Type])=BLANK(),BLANK(),
SELECTEDVALUE('Slicer'[Type])="Type1","Red",
SELECTEDVALUE('Slicer'[Type])="Type2","Yellow",
SELECTEDVALUE('Slicer'[Type])="Type3","Blue")

vzhangti_2-1672728516926.png

Result:

vzhangti_6-1672728651618.pngvzhangti_7-1672728662134.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Thank you so much but I wonder if it is possible to modify dinamically the background colour using rules based on numeric values. Is it possible to change those values while applying filters?forum.PNG

Hi, @JOctavio 

 

You can try the following methods.

Color Measure = 
Var _value=SUM('Table'[Value])
Return
SWITCH(TRUE(),
_value>=0&&_value<=33,"Green",
_value>=34&&_value<=66,"Orange",
_value>=67&&_value<=100,"Red")

vzhangti_0-1673862047338.png

Result:

vzhangti_1-1673862065328.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

@v-zhangti can we actually use this method also for KPIs? In this case should I use this Measure instead Target?

amitchandak
Super User
Super User

@JOctavio , you can use isfiltered for that

 

if(calculate(isfiltered (Table[Category]) , allselected()) , "Red", "Black")

 

You can use that is conditional formatting using field value option

 

example

https://www.youtube.com/watch?v=sXn-QZqLD-8

 

Conditional formatting

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors