cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Conditional Formatting based on Text Filed

Hi

I need to colour format a text field that contains "NNNN" or "DDDD" or "OOOO" or "XXXX".

Can someone please help me achieve this?

Thank you in advance!!!

 Capture5.PNG

1 ACCEPTED SOLUTION
Microsoft
Microsoft

Hi @cocoloco79 ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

View solution in original post

4 REPLIES 4
Microsoft
Microsoft

Hi @cocoloco79 ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

View solution in original post

Super User IV
Super User IV

@cocoloco79 , In matrix you will not be able to color row or column, But can color values.

 

Create a color meausre like -if( CONTAINSSTRING('Table'[field],"NNNN" ) || CONTAINSSTRING('Table'[field],"DDDD" ) || CONTAINSSTRING('Table'[field],"OOOO" ) || CONTAINSSTRING('Table'[field],"XXXX" )
, "yellow", "white")

 

And then use in coditional formatting with "Field Value" Option

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak 

Thank you and sorry I'm new to this all.

I have entered this formula but get an error.

Colour = if( CONTAINSSTRING('vdc_EmployeeLog'[Employee_Name],"NNNN" ) CONTAINSSTRING('vdc_EmployeeLog'[Employee_Name],"DDDD" ) CONTAINSSTRING('vdc_EmployeeLog'[Employee_Name],"OOOO" ) CONTAINSSTRING('vdc_EmployeeLog'[Employee_Name],"XXXX" ), "yellow", "white")
 
A single value for column 'Employee_Name' in table 'vdc_EmployeeLog' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
Thank you

Hi @cocoloco79 ,

 

This is a similar post I answered before. Please kindly refer to:

 

Find if value contains anything from another column

 

If you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors