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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
sebapehl
Frequent Visitor

background color of linechart dependent on xaxis values

i have a linechart x and y for which certain values of x should have a a different background color on the chart vertically

pbi example:

sebapehl_1-1716969083128.png

https://drive.google.com/file/d/1nnKlugbuX4pCabtrzXJ16bQ3aiAwGGqO/view?usp=sharing

expected result: 

sebapehl_0-1716969050804.png

e.g. green background around the odd numbers and no (or another) background around the equal numbers.

 

the original data of the x axis is a timestamp where i want to color the non-business hours (20 to 08).

 

 

 

 

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @sebapehl,

I'm attaching a pbix file with my solution.
The final output is this:

_AAndrade_0-1716971030920.png

You could play around x-axis to change continuos to categorical, but it will depend of how you have your data model.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

3 REPLIES 3
_AAndrade
Super User
Super User

Hi @sebapehl,

I'm attaching a pbix file with my solution.
The final output is this:

_AAndrade_0-1716971030920.png

You could play around x-axis to change continuos to categorical, but it will depend of how you have your data model.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




perfect, thank you!

You're welcome





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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