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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
lawada4
Frequent Visitor

create area chart with green and red colors to indicate profit and loss

I have created area chart that that shows profit and loss % over time. I would like to show the loss (negative part) in red color and the profit ( positive part) in geen color.

lawada4_0-1671111048890.png

 

i created 2 measures one for profit % and one for loss % 

positive p&l =
var pl=[p&l %]
var result= IF(pl>0 , pl,0)
return result
 
negative p&l =
var pl=[p&l %]
var result= IF(pl<0 , pl,0)
return result

 

when i added the measures in the chart it looked  like:

lawada4_2-1671111301053.png

 

any idea on how to create the area chart with green/red colors instead of 1 color

2 REPLIES 2
alvaro_miranda
Frequent Visitor

Could you solve this?

v-jayw-msft
Community Support
Community Support

Hi @lawada4 ,

 

Please share some sample data so that we could test the formula.

 

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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