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
bogilvieiii
Frequent Visitor

Conditional Formatting bar chart visual breaks during filtering

Hello,

 

I made a simple bar chart visual showing the Percent to Plan for a picker and conditionally formatted the bars to be green if greater than or equal to 100%  and red if below 100%.  

The below data is the aggregation of an entire week broken down by work area.

 

 

Bar Chart working.png

On a separate table on the same page, I have the same data broken up by day and when I click on one of the days, the rest of the data filters accordingly.

 

Bar Chart not working.png

 

This is where my conditional formatting breaks and will show a red bar for a work area that is over 100% or green bar that is less than 100% following the week aggregation value instead of the filtered aggregation for the particular day.    

1 ACCEPTED SOLUTION

Yes I found the solve and its actually pretty simple.  You need to find the "edit interactions" button which can be found by first clicking on the date table that is doing the filtering.  From there you should see the format option appear between "help" and "Data/Drill"

bogilvieiii_0-1670524650744.png

After you click on edit interactions each visual will have a small popup that looks like this(highlighted):

bogilvieiii_1-1670524754114.png

 

The options that you are given from left to right are filter, highlight, and none.  For our purposes, you are going to want to select filter option and then you should see the conditional formatting work with that particular interaction between visuals.  You will have to do this with each visual that you want to use as a filter since the default is to highlight instead of filter like we want.  Hope that helps.  

 



 

View solution in original post

8 REPLIES 8
jpurdue
Frequent Visitor

@bogilvieiii I'm currently running into the same issue. Did you ever fix yours? I have a bar chart with a measure color conditioning applied to it. When not filtered, it's fine. When filtered, it breaks. 

 

my color conditioning is set up for field value and my field is "color 2" which is below.

 

color 2 = IF(VALUE(Kalmar[Fleet CMPH])>=14.10,"green","red")
 
I know the measure works correct because I can place this column in a table and it'll work perfectly. 
 

I've tried "SWTICH" too. 

 

color 2 = SWITCH(
    TRUE(),
    AND(Kalmar[Fleet CMPH] >= 0, Kalmar[Fleet CMPH] < 14.1), "Red",
    AND(Kalmar[Fleet CMPH] >= 14.1, Kalmar[Fleet CMPH] < 50), "Green")

your previous measure works fine no need to change it.  Just follow the steps I laid out in my previous reply back to you

Yes I found the solve and its actually pretty simple.  You need to find the "edit interactions" button which can be found by first clicking on the date table that is doing the filtering.  From there you should see the format option appear between "help" and "Data/Drill"

bogilvieiii_0-1670524650744.png

After you click on edit interactions each visual will have a small popup that looks like this(highlighted):

bogilvieiii_1-1670524754114.png

 

The options that you are given from left to right are filter, highlight, and none.  For our purposes, you are going to want to select filter option and then you should see the conditional formatting work with that particular interaction between visuals.  You will have to do this with each visual that you want to use as a filter since the default is to highlight instead of filter like we want.  Hope that helps.  

 



 

Oh jesus that was it?! Thanks!!!!

v-xicai
Community Support
Community Support

Hi   @bogilvieiii ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

amitchandak
Super User
Super User

@bogilvieiii 

Can you share the rule? I prefer create a color measure and use that under conditional formatting by using field and measure

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

Hi @amitchandak 

 

I set the conditional formatting to format by "Field Value" and based it off my "Background Color" which is the following:

Background Color = if(P4P[Percent to Plan]>=1,"Light Green",if(P4P[Percent to Plan]>=.001,"Red",""))
 
The %2P measure is defined as such:
Percent to Plan = divide(sum(P4P[lines]),sum(P4P[Hours]))/average(P4P[Expected_Rate])
 
For good measure here is the structure of the data:  
 Data Structure.png
(The blacked out column is userid's )
 
Thanks for the links, I'm going through them now.  

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.