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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Bar Chart - Shade Between Values

Hello - 

 

I'm trying to tell a story with what's happening in one of my charts. It's a Bar Chart with values on the x-axis and categories on the y-axis. I want to shade between certain values and be able to add contex on what's happening. 

 

I've attached a screenshot for you to preview how ideally this would look. Is there a way to do this in Power BI? I'm using the constant lines on the analytics section, however, I can't shade between the areas. Or at least I haven't figured it out yet. 

 

Here's an Example. Notice the 4 shades of colors. 

 

BarChart.PNG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

This is not possible directly, and I assume your axis will grow in context related like filtering and so on.

 

You can try to add an image on the background of your chart but that woul implie that you would have the exact size of your chart especcially the x-axis always on the same size, other option can be using the stacked bar chart and using 3 measures for example:

 

0 to 40 = if (SUM('Table'[Value]) < 40, SUM('Table'[Value]), 40 )

40 to 50 = if(SUM('Table'[Value]) > 50 , 50 - 40,SUM('Table'[Value]) - [0 to 40] )

OVER 50 = if(SUM('Table'[Value]) > 50 , SUM('Table'[Value]) - [40 to 50] - [0 to 40] )

 

Then using this measures you can do the following formatting:

 

MFelix_0-1613749627344.png

Has you can see both charts are equal but they have the highlight on the bar. Then using the legend you can use the names you need.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

This is not possible directly, and I assume your axis will grow in context related like filtering and so on.

 

You can try to add an image on the background of your chart but that woul implie that you would have the exact size of your chart especcially the x-axis always on the same size, other option can be using the stacked bar chart and using 3 measures for example:

 

0 to 40 = if (SUM('Table'[Value]) < 40, SUM('Table'[Value]), 40 )

40 to 50 = if(SUM('Table'[Value]) > 50 , 50 - 40,SUM('Table'[Value]) - [0 to 40] )

OVER 50 = if(SUM('Table'[Value]) > 50 , SUM('Table'[Value]) - [40 to 50] - [0 to 40] )

 

Then using this measures you can do the following formatting:

 

MFelix_0-1613749627344.png

Has you can see both charts are equal but they have the highlight on the bar. Then using the legend you can use the names you need.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.