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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic Colors for Bar Chart Visualization

Hi,

 

I'd like to create a Bar Chart Visualization that is dynamic.  I'd like the bar values to change color if the value is above a specific value.

 

I've done this in the past using the Analytics Tab and created a Constant Line.  Here is an example of this.  When the bar value are above .05% the bars turn Red, otherwise they remain Green.

 

Capture1.PNG

 

However, I need to make this visualization more dynamic.  I'd like the constant line value to be dependant on a slicer selection:

 

Capture2.PNG

 

Essentially, when the user makes a selection in that slicer, I need the constant line to update according to the value associated with the group.  For example:

 

Group      Value

A              .05% 

B              .07%

C              .02%

 

I tried creating a table like the dummy data above and created realtionships but Constant Lines need to be manually set.  I don't believe they can reference a Measure or Custom Column. 

 

I also tried using a Bar and Line Chart visualization.  While that allowed me to create a horizontal line that matches the Groups Value...I don't know how to make the color of the Bars dynamic....meaning have them change color if the bar is above the line value.

 

Does any of this make sense?  I'm closely monitoring the thread so if you have any questions I will answer them quickly!

 

 

 

Thank you!

Andrew

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , The constant line(under analytics pane) has the option of fx. You can choose a measure.

 

You can use the measure slicer approach to change measure for fx

measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern

 

 

Same way you can create a measure color and use that in conditional formatting using field value option

 

Color = Switch( True() ,

[Bar Meausre] > [selected measure], "Green",

"Red"

)

 

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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , The constant line(under analytics pane) has the option of fx. You can choose a measure.

 

You can use the measure slicer approach to change measure for fx

measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern

 

 

Same way you can create a measure color and use that in conditional formatting using field value option

 

Color = Switch( True() ,

[Bar Meausre] > [selected measure], "Green",

"Red"

)

 

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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you so much for all the help over the past 2 years on this website.

 

Also, great youtube channel too.  Thank you again!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.