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
lucadelicio
Super User
Super User

Matrix background color for specific columns

 

Hi everybody,

i have a matrix with date gerarchy (MM/DD, Weekday) for every task row (commessa).

I'll use the matrix at the day level. I have also a filter by year and month.

I have two requirements:
1. I need to color the saturday and sunday column in red. For all the column and also for the header (also if it is blank value)

In this specific case (20/01, 21/01...)
I don't want 0 instead of a blank.

2. I need to remove the days measure in all the columns day but mantain it only in the total

There is a way to do this?
Thank you very much!

lucadelicio_2-1717434697593.png

 


Here the result attended:

lucadelicio_4-1717435246531.png

 

 



Luca D'Elicio

LinkedIn Profile
2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @lucadelicio  - you can create a custom column in power query to identify weekends by adding a column that checks if the date is a Saturday or Sunday.

#"Added Custom" = Table.AddColumn(#"PreviousStep", "IsWeekend", each if Date.DayOfWeek([DateColumn]) in {0, 6} then "Weekend" else "Weekday")

 

 

Now Go to the format pane of your matrix visual,Conditional Formatting, select  Background Color. Add a rule based on the IsWeekend column. Set the background color to red for the "Weekend" value.

 

Hope it works for the first requirement.

 

2. Create a DAX measure that returns a blank value for all individual days but shows the actual value in the total.

MeasureForDays =
IF (
HASONEVALUE('Date'[DateColumn]),
BLANK(),
SUM('YourTable'[YourMeasure])
)

 

Create another measure for totals values:

 

MeasureForTotal = SUM('YourTable'[YourMeasure])

 

Use the above two measures in your matrix visualization field values for day level data to ensure for blank and measure for total is for GT row in your matrix

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Nope
1. It remain the empty column in every day and not only the total
2. It works only for the day with a value (that are not the weekend days and are not to be red).



Luca D'Elicio

LinkedIn Profile

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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