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
Bhavya98
Regular Visitor

How to create line graph having partial colored background.

Hi All,

 

I want to create a visual as shown below.

Bhavya98_0-1669271787806.png

I have taken a line and stacked column chart but with that i am able to achieve this visual as shown below:

Bhavya98_1-1669271895692.png

I want this green background to cover months till september how can i achieve that?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Bhavya98 ,

 

For this you need to create a measure and then use it has your values in the bar or the line chart something similar to:

 

DateColour = if( EOMONTH(MAX('Calendar'[Date]), 0) <= date(2022, 9,30), 1)

Now use this metric has your background:

MFelix_0-1669280424259.png

In my example I use may has the base value but has an example it works properly.

 


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 @Bhavya98 ,

 

For this you need to create a measure and then use it has your values in the bar or the line chart something similar to:

 

DateColour = if( EOMONTH(MAX('Calendar'[Date]), 0) <= date(2022, 9,30), 1)

Now use this metric has your background:

MFelix_0-1669280424259.png

In my example I use may has the base value but has an example it works properly.

 


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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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