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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bnjmnnl
Helper III
Helper III

Formatting background of value-column in a matrix

Hello!

I'm using a matrix visual to display average time (hours & minutes) per department per day. I'm using a column displaying the day of the week as a value to show as columns in the matrix:

bnjmnnl_0-1753779827953.png

00:00 meas less then a minute, empty cells mean no data available. I want to format the matrix to show the whole Saturday and Sunday columns in a different color. Using specific column won't work as my value for column is a dataset-column called Day Name. Also I want to color every cell in these columns, not only the cells displaying a value. 

Is there a way to achieve this?

Thank you in advance!

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

Hi @bnjmnnl 

 

If there is no data avilable you can't format the cell so we need to artifically add it in.

Either:
Add some rows into the data so every day of the week at least has a row returning 0.

Or use a measure that adds 0 to the calculation: 

Sum of Price = SUM(Sales[Price 2]) + 0
 
Then you can create a measure that will format the columns:
Check weekday =
 IF(
    SELECTEDVALUE(Sales[Weekday]) --If the column in the Columns of the Matrix
    IN {"Saturday", "Sunday"} --Is equal to saturday or sunday
    ,"Green" -- Return this colour, you can also use hex codes #00FF00
 )
 
Assign this measure as the Cell Elements | Background colour | Field Value
SamWiseOwl_0-1753780707532.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

3 REPLIES 3
v-hjannapu
Community Support
Community Support

Hi @bnjmnnl,

Thank you  for reaching out to the Microsoft fabric community forum and also Thanks to @bnjmnnl@wardy912,

for those inputs on this thread. 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

Best Regards,
Harshitha.


 



wardy912
Impactful Individual
Impactful Individual

Hi @bnjmnnl 

 

 Add a measure as follows

 

DayColumnColor = 
VAR SelectedDay = SELECTEDVALUE('Date'[Day Name])
RETURN
    SWITCH(
        SelectedDay,
        "Saturday", "#FFE6E6",  // Light red
        "Sunday", "#FFE6E6",    // Light red
        BLANK()
    )

 

Go to 'cell elements' for the matrix visual, turn on backgroung colour and select the conditional formatting button (fx)

wardy912_0-1753782678743.png

 

Add your measure as a field value

wardy912_1-1753782922096.png

wardy912_2-1753782954466.png

 

I hope this helps! Please give a thumbs up and mark as solved if it does, thanks!

SamWiseOwl
Super User
Super User

Hi @bnjmnnl 

 

If there is no data avilable you can't format the cell so we need to artifically add it in.

Either:
Add some rows into the data so every day of the week at least has a row returning 0.

Or use a measure that adds 0 to the calculation: 

Sum of Price = SUM(Sales[Price 2]) + 0
 
Then you can create a measure that will format the columns:
Check weekday =
 IF(
    SELECTEDVALUE(Sales[Weekday]) --If the column in the Columns of the Matrix
    IN {"Saturday", "Sunday"} --Is equal to saturday or sunday
    ,"Green" -- Return this colour, you can also use hex codes #00FF00
 )
 
Assign this measure as the Cell Elements | Background colour | Field Value
SamWiseOwl_0-1753780707532.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

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