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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alvaro_miranda
Frequent Visitor

Dynamic Formatting Area chart

Hi,

 

I want to create an area chart that changes to red(area and line color) when a measure is negative and be  green when positive like this:

alvaro_miranda_0-1725637733039.png


Is there a way to do this in powerbi or a custom visual i cannot find anything.

 

Thanks!

1 ACCEPTED SOLUTION
FlipFlop1
Advocate I
Advocate I

Not the full solution, but half a solution:

Conditional formatting is available for bar charts, but I can't see it for line or area charts.
You can start with a column chart and set the conditional formatting under Visual > Columns > Color as follows, using a field with the color hex in your table (click on the FX button and select field value and then the hex color from your table).

FlipFlop1_0-1725810024977.png

FlipFlop1_1-1725810142226.png

This will give you a bar graph with conditional coloring as follows:

FlipFlop1_2-1725810205737.png

If you then change the graph to Line, it retains the colors as the markers, but not for the line.

FlipFlop1_3-1725810257971.png

There doesn't appear to be a marker setting, but it does seem to work.

View solution in original post

2 REPLIES 2
FlipFlop1
Advocate I
Advocate I

Not the full solution, but half a solution:

Conditional formatting is available for bar charts, but I can't see it for line or area charts.
You can start with a column chart and set the conditional formatting under Visual > Columns > Color as follows, using a field with the color hex in your table (click on the FX button and select field value and then the hex color from your table).

FlipFlop1_0-1725810024977.png

FlipFlop1_1-1725810142226.png

This will give you a bar graph with conditional coloring as follows:

FlipFlop1_2-1725810205737.png

If you then change the graph to Line, it retains the colors as the markers, but not for the line.

FlipFlop1_3-1725810257971.png

There doesn't appear to be a marker setting, but it does seem to work.

lbendlin
Super User
Super User

yes, this can be implemented. Is the static horizontal line not enough?

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.