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
lkeck
New Member

Stacked area chart groups for positive and negative values?

Is it possible to create groups in the stacked area chart?

 

I would like to have one group of positive values that stack amongst eachother on the top of the axis above zero, and another group of negative values that stack amongst eachother on the bottom of the axis below zero.  Each group would stack relative to the center axis of zero.  Currently it appears all values will stack against eachother regardless of being a positive or negative value.

 

Trying to achieve something similar as the graph below (using plotly) which you can define stack groups.  The blue area is above zero, and the orange and red area stack below zero separately.

area_stack_ex.PNG

 

It seems like you can do this with stacked bar charts but not stacked area charts?

Power-BI-Diverging-Bar.png

3 REPLIES 3
AllisonKennedy
Super User
Super User

I'm not exactly sure how you are defining if the value is positive or negative - did you want that to change based on slicer selection? It matters what order you place the fields in the values pane, just as order matters with subtraction, but that still won't give you exactly what you're asking.

 

I think key is to create the right measures, so for the positive values add ABS() of the negative, which will essentially give you the right balance you're looking for, but will change your tooltip so you'll want to keep an eye on that too.

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@lkeck , In the line clustered chart you can use shade area on. You can only have lines. The above one should happen in that case.

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
mahoneypat
Microsoft Employee
Microsoft Employee

I played with the area chart some, and was able to get your desired outcome if I had two measures (one with negative, one with positive values).  If you just have two category values you are comparing, you could write two measures, one with Calculate([yourmeasure], Table[Category]="A") and the other with Calculate([yourmeasure], Table[Category]="B").  If you have many categories, you would need to have two slicers (maybe with a disconnected table or two) to pick the two categories for comparison in the chart.

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors