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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

conditional formating for weekends in the matrix visual

I need highlight saturday  and sunday with colors for the below matrixCommunity 18.06.PNG

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a measure like this checking the weekday value

if(FIRSTNONBLANK(Table[Value],"true") = "true","green","red")

or

if(FIRSTNONBLANK(Table[Weekday],"AnyDay") in {"sun","sat"},"green","red")

 

And the in conditional formatting use field option with this measure

Steps :

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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

View solution in original post

Anonymous
Not applicable

HI @Anonymous,

You can use below measure formula to add a measure and setting condition formation on your value field based on measure result:

Measure =
VAR currDay =
    MAX ( 'Table'[Day] )
VAR currDate =
    DATEVALUE ( currDay & "-" & MAX ( 'Table'[Month] ) )
RETURN
    IF ( WEEKDAY ( currDate, 2 ) > 5, "Blue", "Black" )

9.png

Since I'm not so sure your table structure, can you please share some dummy data with a similar datas tucute and visual design to help us clarify your scenario?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @Anonymous,

You can use below measure formula to add a measure and setting condition formation on your value field based on measure result:

Measure =
VAR currDay =
    MAX ( 'Table'[Day] )
VAR currDate =
    DATEVALUE ( currDay & "-" & MAX ( 'Table'[Month] ) )
RETURN
    IF ( WEEKDAY ( currDate, 2 ) > 5, "Blue", "Black" )

9.png

Since I'm not so sure your table structure, can you please share some dummy data with a similar datas tucute and visual design to help us clarify your scenario?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@Anonymous , Create a measure like this checking the weekday value

if(FIRSTNONBLANK(Table[Value],"true") = "true","green","red")

or

if(FIRSTNONBLANK(Table[Weekday],"AnyDay") in {"sun","sat"},"green","red")

 

And the in conditional formatting use field option with this measure

Steps :

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

If you are not using date dimension in your model and you haven't got a weekday column already, you can use this measure for conditional formating In your Matrix visual

isWeekend = INT( WEEKDAY( SELECTEDVALUE( 'Table'[Date] ), 2 ) IN { 6, 7 } )
 
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

no i have date dimension seperately

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors