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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

1 REPLY 1
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors