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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rajesh9147
Regular Visitor

Custom line chart with background shading differentiating last year vs this year

Hi All,

I have a requirement to compare last year data with current year data with a line chart and show the differentiation using background color shading. For ex, all the months in the last year 2020 should have a background shading with one color and current year 2021 with a different color shading. Sample attached. If exactly the same is not possible then, any other closeby ideas also appreciated.

Thanks

RajMockup.jpg

3 REPLIES 3
rajesh9147
Regular Visitor

Hello,

 

Thanks for your reply. I have tried the X-Axis Constant line and I got the background shade for the last year. I am looking for 2 lines with the current year and last year but I am missing all month's information on X-Axis. I have attached the latest screenshots. 

 

When I apply Type Continuous, I am able to see the background and missing Feb 2021 on X-Axis.

When I apply Type  Categorical, I am able to see All month's information but not the background.

 

Please let me know if I missing anything here.Categorical.PNGContinuous.PNG

 

Thanks,

Rajesh

Howdy, I'm please it worked ๐Ÿ™‚

 

That is expected behaviour for continuous axes, as they are continuous, there is no need to plot all values, especially if it is a measure that can be split into fractions. 

Data: Continuous vs. Categorical (eagereyes.org)

 

 

You should be able to add a second constant line on a continuous axis:

KerKol_0-1636488518371.png

and then add shade after

KerKol_1-1636489299873.png

 





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

Proud to be a Super User!




KerKol
Power Participant
Power Participant

Hello,

 

You can do this with the X-Axis Constant line:

 

KerKol_0-1636244355521.png

 

With the in-built line visual, in the Analytics Pane:

KerKol_1-1636244420019.pngKerKol_2-1636244461786.png

Add a line, set the date hardcoded or using a formula.

 

Add shading and data label.

 

Let me know how you go ๐Ÿ™‚





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

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors