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
lovishsood1
Resolver I
Resolver I

Highlight Weekends on Matrix Visual

Hey!
 I have one Matrix Visual as : 

Column Header: Date Table (Calendar)

Row Header: Table 1

Values: Table 2(Calculated Column)

 

I have applied Conditional Formatting on Values (Background color) via Field Value Formatting Style.

 

Now, I also want to highlight Weekends

lovishsood1_0-1644215606186.png

 As you can see 15 and 16 January are Sat & Sun. So I want to highlight them with another color but as Conditional Formatting is already applied on Values 15&16 Jan are getting highlighted with given colors. 

In Conditional Formatting , I have set this for BG Colors :
ValuesColor = SWITCH(TRUE(),
_Table2[_Total]=" ","
Yellow",
_Table2[_Total]="AM","
Purple",
_Table2[_Total]="PM","
Purple"
)

How I can highlight Weekends on Columns Headers and Values as well with a specific Color?

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @lovishsood1 

 

Try using this measure for conditional formatting instead. I put your ValuesColor column in it. 

ColorMeasure =
IF (
    WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) >= 6,
    "Green",
    SELECTEDVALUE ( 'Table 2'[ValuesColor] )
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

6 REPLIES 6
v-jingzhang
Community Support
Community Support

Hi @lovishsood1 

 

Try using this measure for conditional formatting instead. I put your ValuesColor column in it. 

ColorMeasure =
IF (
    WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) >= 6,
    "Green",
    SELECTEDVALUE ( 'Table 2'[ValuesColor] )
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi,

It looks like It's highlighting only selected fields but I need to highlight All the cells from Top to bottom.

lovishsood1_0-1644733823998.png

As you can see, it only highlighted where data exists but I want to highlight all cells along with the Header. To show that Feb 5&6 are Weekends.

Hi @lovishsood1 

 

It seems whether data (the value field) exists, there is some filter passing so it couldn't get the correct unique date when data doesn't exist (blank). I did a test, when I put a simple measure Value = 1 in Values, there is no blank data. So the color measures works well. You can see the following image. 

vjingzhang_0-1644998355591.png

 

Unfortunately, I couldn't figure out how to set up the correct color when data is blank. Maybe the IF logic should be more complex but I have no idea currently.

 

In addition, conditional formatting feature is only applied to Values and Totals at present. It couldn't be applied to row headers and column headers. There are some similar ideas you can vote up:

Microsoft Idea - conditional formating for column header

Microsoft Idea - Conditional Formatting to Row/Column Headers

Microsoft Idea - Column Conditional Formatting in a Matrix

 

Best Regards,

Jing

Yeah, Thanks. I got that. We don't have any option to highlight Column Header where Weekends are there. Only Values are highlighted where Weekends exists.

amitchandak
Super User
Super User

@lovishsood1 , You can create a color measure or can merge this code with another color measure 

 

Switch(True() ,

Weekday(max('Date'[Date]),2) >=6, "Yellow",

"Green"

)

 

Use this in conditional formatting using field value option

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have Calculated Column of colors  in Table 2 so I'm not able to fetch the Date Table there.

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