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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
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
Top Kudoed Authors