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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Conditional formatting of PowerBi table

I am having trouble figuring this out. I have followed instructions found elsewhere on the forum but I can't seem to get it to work.

 

I have a table with multiple columns, one column contains due dates which are listed in the following format (YYYYMMDD) and I want the rows to be highlighted as follows:

 

- Red if due date is today or has already past

- Yellow if due date is within 30 days of today

- Green if due date is greater than 31 days from today

 

Your help is greatly appreciated! Thanks 

 

1 ACCEPTED SOLUTION

1. You can do this way

serpiva64_0-1646685177013.png

select each column and then apply conditional formatting with the same rule

serpiva64_1-1646685552218.png

 

 

2. you can use what color you want:

DateDueColor = if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY(),"LIGHT BLUE",if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY()+30,"YELLOW","#70BBFF"))
3. You can remove the column and it function

View solution in original post

3 REPLIES 3
serpiva64
Solution Sage
Solution Sage

Hi,

You can try this way:

serpiva64_1-1646675427160.png

creating a calculated column:

DateDueColor = if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY(),"RED",if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY()+30,"YELLOW","GREEN"))
 
and then in Conditional formatting:
serpiva64_2-1646675517882.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

Anonymous
Not applicable

Hi there,

 

thanks for your response. It worked! However, three questions:

 

1. I would like the entire row to be conditionally formatted rather than the column - for instance, if line item one is overdue, I want that entire row in the table to be red)

 

2. The green color shown is too dark so how can I change the shade of green with a custom hex # instead of standard green for instance?

 

3. I don't want the DateDueColor column to be in my table. I now have a column with values of GREEN, YELLOW and RED.  How do I remove this from the table without eliminating the formatting?

1. You can do this way

serpiva64_0-1646685177013.png

select each column and then apply conditional formatting with the same rule

serpiva64_1-1646685552218.png

 

 

2. you can use what color you want:

DateDueColor = if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY(),"LIGHT BLUE",if(DATEVALUE(left('Table'[DateDue],4)&"-"&MID('Table'[DateDue],5,2)&"-"& RIGHT('Table'[DateDue],2))<=TODAY()+30,"YELLOW","#70BBFF"))
3. You can remove the column and it function

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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