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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PabloGiraldo
Helper IV
Helper IV

Dates Traffic Light

Hi,

 

I would like a column that turns red, yellow, green if today's date is within 0-30 days, 31-45 days, 46-90 days, respectively. 

 

See attached screenshot for reference.

 

Thank you,

Pablo8.JPG

2 ACCEPTED SOLUTIONS
lkalawski
Super User
Super User

@PabloGiraldo 

I corrected your measure and conditional formatting.

lkalawski_0-1612216198549.png

 

Please find an attachment.

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

 

View solution in original post

Anonymous
Not applicable

Hi  @PabloGiraldo  ,

Here are the steps you can follow:

1. Create calculated column.

day = DATEDIFF(MAX(Submittals[Required date]),TODAY(),DAY)

2. In Format, select Conditional formatting, select the field Indicator, and turn it on

v-yangliu-msft_0-1612340340753.png

3. Select Format by as Rules and Based on field as [day]

Grant conditions:

Red: 0<=day<30

Yellow: 30<=day<45

Green: 45<=day<90

Date more than 90 days to differentiate from a small green circle

v-yangliu-msft_1-1612340340774.jpeg

4. Result.

v-yangliu-msft_2-1612340340777.jpeg

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi  @PabloGiraldo  ,

Here are the steps you can follow:

1. Create calculated column.

day = DATEDIFF(MAX(Submittals[Required date]),TODAY(),DAY)

2. In Format, select Conditional formatting, select the field Indicator, and turn it on

v-yangliu-msft_0-1612340340753.png

3. Select Format by as Rules and Based on field as [day]

Grant conditions:

Red: 0<=day<30

Yellow: 30<=day<45

Green: 45<=day<90

Date more than 90 days to differentiate from a small green circle

v-yangliu-msft_1-1612340340774.jpeg

4. Result.

v-yangliu-msft_2-1612340340777.jpeg

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Thank you!

lkalawski
Super User
Super User

@PabloGiraldo 

I corrected your measure and conditional formatting.

lkalawski_0-1612216198549.png

 

Please find an attachment.

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

 

Thanks for the help. I do have one question. Seems like you fixed part of it but seems like the formula is not working correctly. There are some dates that are past 90 days and these should be green. There are also some dates of December 2020. Shouldnt these be green instead of yellow?

 

Taking today as the example:

Red = 02/01/2021 - 03/03/2021 (0-30 days)

Yellow = 03/04/2021 - 03/19/2021 (31-45 days)

Green = 03/20/2021 - 5/2/2021 (46-90 days)

121.JPG

Thanks!

Pablo

 

lkalawski
Super User
Super User

Hi @PabloGiraldo ,

You have to create a measure that will return the color code based on the Required Date. And then you can use it in the conditional formatting as a parameter.

 

Please share sample of data or your .pbix file and I can help you.

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

file in the link below. The slicer i created should filter table as i slide to a certain date range (i.e. 31-45 days or so). Thank you!

 

https://walshgroup-my.sharepoint.com/:u:/p/pgiraldoclavijo/EflsSIXQn5lNqMJUZ_y1lIEBalfwbhFiNq6WYXX32... 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.