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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.