cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Weekend highlighting line chart

Howto add visualization of weekends?  Best would be to colorize weekend sections the line itself.  But this method below would be helpful too.

Please refer to picture below:

Visualize weekends.

 

 

 

Thank you!

 

4 REPLIES 4
Highlighted
New Member

Weekends, line chart, add colorization to line for weekends - howto?

weekendsOr adding a bar like this, but coloriznig the line is prefereable.  Thanks!

Highlighted
New Member

Weekends, show colorization of line chart, howto?

Colorizing the line is preferable, but this bar is ok too, how to do this?

Highlighted
Anonymous
Not applicable

Re: Weekend highlighting line chart

Add a column in Query Editor to check for weekends.

 

Click Add Column...Add Custom Column, and paste in the following:

 

if Date.NameOfDay([Date Column]) = "Saturday" then "Weekend" else if Date.NameOfDay([Date Column]) = "Sunday" then "Weekend" else "Weekday"

 

Then add that column as a legend to your line chart.

Highlighted
Microsoft
Microsoft

Re: Weekend highlighting line chart

@gendat

If you use the ChrisHaas’s formula to create custom column, you would need to change the formula to the following:

if Date.DayOfWeekName([Date]) = "Saturday" then "Weekend" else if Date.DayOfWeekName([Date]) = "Sunday" then "Weekend" else "Weekday"
1.JPG

Alternatively, you can create a calculated column using DAX below. And you can create Line chart or column chart as shown in the following screenshots.

CheckWeekend = IF( OR(WEEKDAY(Table[Date])=1,WEEKDAY(Table[Date])=7),"Weekend","Weekday")
2.JPG3.JPG4.JPG


Regards,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors