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
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
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.