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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Shaded area of line chart

Hey Friends,

I've got a problem I can't seem to solve.

I want to shade an area of a line graph. I have multiple seasons stacked on top of each other in a line graph. A season spans more than one year so the dates that run on the access are actually relative dates. So instead of Jan 2016, I have Jan Y1 Feb Y1 etc.

Here is an example:

Current Graph.jpg

 

 

 

 

 

 

 

What I need to do is call out a specic time frame with a shaded box. Like this:

Desired Graph.jpg

I found a work around on this forum, but it uses line and COlumn chart.... but that only has one line on it and my user is asking for 3 lines.

https://community.powerbi.com/t5/Desktop/Reference-Line-on-x-axis/m-p/91405#M38566

 

I also thought about just putting a transparent shape on top of the page, but the page is dynamic and the visuals are used in presentations so we want to be able to put this full screen and have the box still show up properly.

 

Any ideas?

11 REPLIES 11
parry2k
Super User
Super User

@hiolka here is the solution on my channel. Learn DAX techniques to highlight or shade data points in the visuals - Time Intelligence Power BI -...



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous in August there was a new feature release that can address this, check at this link. Power BI August 2021 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous I think I have solution in mind, it is going to be layer of two visual to give that box look and feel. Share your sample data and the area you want to highlight and will get you the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hey @parry2k ,

I was using a shape to lay over the visual at first. Which works fine until the user goes into focus mode and then the shape isn't present.

 

If I was to use two visuals, I think I'd run into the same problem?

 

Thanks so much for the help, I'll work on making some sample data

@Anonymous i already tested at my end with lay over and it works fine, just need to do some dax calculations to make sure focus stays the way it is



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@Anonymous here is an example what I did 

 

shaded area1.gif



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k  - could you please post here / on your YT-channel the details of your solution? It seems interesting, the workarounds usually suggest playing with constant lines (in Analytics tab) and their shading is far from perfection. Thank you in advance!

Anonymous
Not applicable

Hey @parry2k ,

That looks amazing! I've put some sample data below. I'm using the relative Year/Month as my date.

 

If you're willing to post the PBIX or sample code, I'm sure I can work back with my own data too 🙂

 

Again,That looks awesome, I'm excited to get it in my own report!

 

Walk DateSalesFiscal Half
Jan Y1$1,004,2371H 2018
Jan Y1$1,092,8101H 2019
Feb Y1$1,075,1521H 2018
Feb Y1$1,080,0691H 2019
Mar Y1$1,084,1401H 2018
Mar Y1$1,092,3671H 2019
Apr Y1$993,6131H 2017
Apr Y1$1,006,9531H 2018
Apr Y1$1,099,3871H 2019
May Y1$1,028,0631H 2017
May Y1$971,2431H 2018
May Y1$1,031,5531H 2019
Jun Y1$987,6731H 2017
Jun Y1$972,6161H 2018
Jun Y1$1,020,1841H 2019
Jul Y1$1,052,5241H 2017
Jul Y1$1,058,9691H 2018
Jul Y1$1,001,5461H 2019
Aug Y1$1,071,6341H 2017
Aug Y1$1,050,8761H 2018
Aug Y1$997,8441H 2019
Sep Y1$1,073,9861H 2017
Sep Y1$1,031,9631H 2018
Sep Y1$1,083,5831H 2019
Oct Y1$1,070,2641H 2017
Oct Y1$985,0781H 2018
Oct Y1$1,079,9751H 2019
Nov Y1$1,076,7361H 2017
Nov Y1$1,029,2831H 2018
Nov Y1$1,070,1761H 2019
Dec Y1$1,066,5621H 2017
Dec Y1$1,028,5161H 2018
Dec Y1$1,073,6371H 2019
Jan Y2$1,073,4191H 2017
Jan Y2$975,5351H 2018
Jan Y2$1,018,4781H 2019
Feb Y2$979,8251H 2017
Feb Y2$988,1941H 2018
Feb Y2$1,099,6971H 2019
Mar Y2$1,089,7851H 2017
Mar Y2$1,004,5451H 2018
Mar Y2$1,005,2031H 2019
Apr Y2$1,015,4021H 2017
Apr Y2$1,035,7811H 2018
Apr Y2$1,065,0621H 2019
May Y2$1,054,9881H 2017
May Y2$1,094,0531H 2018
Jun Y2$982,3481H 2017
Jun Y2$997,9891H 2018
Jul Y2$1,088,4261H 2017
Jul Y2$1,067,7331H 2018

@Anonymouswould you mind putting everything in a pbix, like your line graphs etc and I will work from there. It will same some time for me 🙂



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hey @parry2k ,

sorry about the delay, had a long weekend.

 

I've got it in a PBIX, but it took me awhile to figure out how to get it in a message

 

Below is a link:

Adding a box to line chart

 

 Thanks for the help!

 

Anonymous
Not applicable

@parry2k 

Has this question addressed? I am having same issue. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.