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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
boyerusmc
Frequent Visitor

Stacked bar chart formatting

Hello! I've read a couple posts about conditional formatting for a stacked bar chart and the only one post was close.

Unfortunately, it's a burden to have to conditionally format using measures, especially because the legend then has to show the those measure values which is less than elegant. I have a chart with budget and remaining stacked. I just want any remaining balances that fall below $0 to be red.

 

1 ACCEPTED SOLUTION

Hello @boyerusmc -

I've done something similar in the past, and it involves making two measures for value that could be negative:

Total Remaining Neg = var __tot = CALCULATE(SUM('Table'[Remaining]))
return IF (__tot < 0, __tot, 0)
Total Remaining Pos = var __tot = CALCULATE(SUM('Table'[Remaining]))
return IF ( __tot >= 0, __tot, 0)

Then rename them after you put them in as values, change the colors, and

2020-08-06 10_00_54-Window.png

I hope this helps,

David

View solution in original post

7 REPLIES 7
V-pazhen-msft
Community Support
Community Support

@boyerusmc 

 

I don't see any conditional format option for stacked bar chart. Can you provide a sample of what do you have now? Or what do you want to achieve.

 

Regards
Paul

Providing a visual example. I want any bar that falls below $0 to be red.

 

boyerusmc_0-1596721809710.png

 

Sorry - part two: snapshot below shows there's no option for advanced controls / conditional formatting for the data colors.

 

boyerusmc_0-1596722443647.png

 

Hello @boyerusmc -

I've done something similar in the past, and it involves making two measures for value that could be negative:

Total Remaining Neg = var __tot = CALCULATE(SUM('Table'[Remaining]))
return IF (__tot < 0, __tot, 0)
Total Remaining Pos = var __tot = CALCULATE(SUM('Table'[Remaining]))
return IF ( __tot >= 0, __tot, 0)

Then rename them after you put them in as values, change the colors, and

2020-08-06 10_00_54-Window.png

I hope this helps,

David

Thanks David, this worked like a champ!

dedelman_clng
Community Champion
Community Champion

Hi @boyerusmc - can you show an example of what you're trying to do and what the issue is?

 

 

amitchandak
Super User
Super User

@boyerusmc , I doubt you can do conditional formatting in stacked chart visual.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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 MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.