Forum Discussion
conditional formating for weekends in the matrix visual
I need highlight saturday and sunday with colors for the below matrix
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- Anonymous6 years ago
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" )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
4 Replies
- Mariusz
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- AnonymousNot applicable
no i have date dimension seperately
- amitchandak
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 - AnonymousNot 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" )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