Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

Help I have a problem, I want to filter by the color that was put in the conditional formatting for the color background

Kepin_0-1682515497587.png

From this conditional format, I want to filter later by color, example that only yellow ones come out.

Kepin_1-1682515535790.png

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors