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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

How to create a line chart with range area in the background

Hello,

I am trying to create a Line chart with a range in the background (See pic below). The idea of the range is to show the normal range for the plot; anything outside of the range is considered abnormal. We want users to see whether the data point is within the range or outside the range. The screenshot shows how the graph looks like in R shiny, where the green area in the background represents the range, and the line represents the actual data points.   Is there a way that I can recreate this in PowerBI? I really appreciate any advice. Thanks

 

Jasleenm_0-1617722626134.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous ,

 

After some research, I suggest that you can use R or Python visuals in Power BI Desktop. You can create the chart using the "Polygon()" function. Here is my test.

v-yuaj-msft_0-1618911201532.png

Result:

v-yuaj-msft_1-1618911236160.png

polygon() 

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Anonymous
Not applicable

@Anonymous thanks alot it worked.

View solution in original post

8 REPLIES 8
radhey_rec
Resolver II
Resolver II

Hi @Anonymous,

 

If you can user custom visuals, you can try https://pbivizedit.com

I am able to create following chart:

radhey_rec_0-1640076091702.png

with the following data:

radhey_rec_1-1640076117692.png

 

Please note that, these visuals do not support (yet):

1. Native tooltips of Power BI.

2. selection of data points for further filtering.

 

Thanks,

-R

 

Anonymous
Not applicable

Hi @Anonymous ,

 

After some research, I suggest that you can use R or Python visuals in Power BI Desktop. You can create the chart using the "Polygon()" function. Here is my test.

v-yuaj-msft_0-1618911201532.png

Result:

v-yuaj-msft_1-1618911236160.png

polygon() 

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

That looks like a great solution. I'll be grateful if you could post the R code that you used to produce that result. With no knowledge at all of R, I tried to figure it out myself from on-line documentation and didn't get very far.
Assuming it is R, of course.

Anonymous
Not applicable

@Anonymous thanks alot it worked.

Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, it seems that there is no custom visual in Power BI that can fully meet your requirements. So I did a test to find something workaround. Is the following result what you want?

v-yuaj-msft_0-1617868916085.png

I just create a stacked chart visual and set the color of "minimum" as white. 

v-yuaj-msft_1-1617869054627.png

v-yuaj-msft_2-1617869079259.png

If you set the maximum and value columns to the same color, this may better meet your needs.

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , I doubt you can do that with standard visual.

check some custom visual

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

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
Anonymous
Not applicable

@amitchandak Thanks for replying. I have been checking some custom visuals but I have not found any good fit so far. If you have any recommendations then please let me know. 

@Anonymous , check if this one can help

https://blog.pragmaticworks.com/power-bi-custom-visuals-chartaccent-linechart

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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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