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 September 15. Request your voucher.

Reply
Richard_Halsall
Helper IV
Helper IV

Matrix Conditional Formatting for row value which is text

Hi,

I have created a calculated column to enable me to colour a text value in a matrix visualisation - these values are correct.

 

However when I use this to colour a text value in a matrix I am getting incorrect results - the cell should be coloured red if the value is No Technician - I have attached a screenshot of the visual.

Richard_Halsall_0-1663927416910.png

 

The conditional formatting rule is

Richard_Halsall_1-1663927487480.png

 

Any suggestions would be appreciated as I am struggling to understand why this does not work. Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Richard_Halsall ,

In order to make troubleshooting and give you a suitable solution quickly, could you please provide the following info?

1. Some raw data with Text format(exclude sensitive data)

2. If the field RoleFilledColour is a calculated column, please provide the related formula

3. How did you set your matrix visual? (Fields option settings)

yingyinr_0-1664180744256.png

4. What's your expected result? Do you want to make the backgroud color is red if the value is "No Technician", otherwise, green?

Best Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Richard_Halsall ,

In order to make troubleshooting and give you a suitable solution quickly, could you please provide the following info?

1. Some raw data with Text format(exclude sensitive data)

2. If the field RoleFilledColour is a calculated column, please provide the related formula

3. How did you set your matrix visual? (Fields option settings)

yingyinr_0-1664180744256.png

4. What's your expected result? Do you want to make the backgroud color is red if the value is "No Technician", otherwise, green?

Best Regards

Hi,

1) Link to data

2) I have tried with a column 

RoleFilledColour =
    SWITCH(TRUE(),
        'FactDemandAllocation'[TechnicianName]="No Technician","Red","Green")
And a measure
RoleFilled =
SWITCH(
    TRUE(),
    MAX(FactDemandAllocation[TechnicianName]) = "No Technician", "Red",
    MAX(FactDemandAllocation[TechnicianName]) <> "No Technician", "Green"
)
 
3) Richard_Halsall_0-1664184187264.png

 

4) I would like to make the background color red if the value is "No Technician", otherwise, green

 

The matrix is affected by slicers with relationships to the date field and opportunity field of the data

 

Thanks

Anonymous
Not applicable

Hi @Richard_Halsall ,

You can follow the steps below to get it, please find the details in the attachment.

1. Create a measure as below

Conditional Formatting = 
IF (
    SELECTEDVALUE ( 'FactDemandAllocation'[TechnicianName] ) = "No Technician",
    "Red",
    "Green"
)

2. Apply conditional formatting in the matrix

yingyinr_0-1664267412507.png

Best Regards

amitchandak
Super User
Super User

@Richard_Halsall , Prefer to create a color measure, not column

 

examples

 

Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)

 

or

 

Switch( True() ,
[Percent] =1 , "Green"
[percent] <.75 , "red",
[percent] <.99 , "Yellow"
)

 

 

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

@amitchandak Hi, thanks for the reply I have just implemented the measure and the unfortunately the results are the same

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.