Reply
PioneerZhu
Microsoft Employee
Microsoft Employee
Partially syndicated - Outbound

How to setup color code for date value

Thank you first!

I am tracking different milestone dates in a PBI table as below, instead of creating flag columns for each date,  is there a simple way if the date is before today, then showing as green font color?

 

Thanks again!

PioneerZhu_0-1740014617751.png

 

1 ACCEPTED SOLUTION

Syndicated - Outbound

hello @PioneerZhu 

 

here is the table that might be closer to your table.

Irwan_2-1740020961111.pngIrwan_3-1740020977865.png

 

do you accept visual like this?

Irwan_0-1740020801845.png

since this is matrix, or else using table visula will be look like this.

Irwan_1-1740020862020.png

 

if you good with either of those two, the process is same as above (unpivot those date tables)

 

Thank you.

View solution in original post

6 REPLIES 6
PioneerZhu
Microsoft Employee
Microsoft Employee

Syndicated - Outbound

Thank you @Chew_WenJie and @Irwan I knew about create new measure, just I need to track lot of columns which are all date value(request date, approval date, start date, complete date, test date, accept date....), I just don't want to create so many measures for each one. 

Syndicated - Outbound

hello @PioneerZhu 

 

if you dont want to create multiple measure and multiple color assignment, i would unpivot all those date column and use matrix visual instead of table visual.

 

1. i assumed you have another column to differentiate those date such as ID

Irwan_0-1740018371477.png

2. unpivot that table so you will have only one date column

Irwan_1-1740018388798.png

3. plot into matrix visual

Irwan_2-1740018472648.png

4. assign color measure to date column (from Cell Elements)

Irwan_3-1740018531510.png

5. the rest is same as above.

 

Hope this will help.

Thank you.

PioneerZhu
Microsoft Employee
Microsoft Employee

Syndicated - Outbound

Thank you thank you @Irwan and appreciate your time. I am with you on the logic. Just my raw data is already in this way as your picture and the "ID" is consisted with multi several columns as 2nd picture. 

PioneerZhu_0-1740019490318.png

 

PioneerZhu_1-1740019864532.png

 

 

Syndicated - Outbound

hello @PioneerZhu 

 

here is the table that might be closer to your table.

Irwan_2-1740020961111.pngIrwan_3-1740020977865.png

 

do you accept visual like this?

Irwan_0-1740020801845.png

since this is matrix, or else using table visula will be look like this.

Irwan_1-1740020862020.png

 

if you good with either of those two, the process is same as above (unpivot those date tables)

 

Thank you.

Irwan
Super User
Super User

Syndicated - Outbound

hello @PioneerZhu 

 

i am not sure how your table looks like, but it is possible.

 

here is a simple example i made.

Irwan_0-1740016672691.png

1. create a new measure for defining color (you can change "Green" and using color code to match your preferences)

Color = 
IF(
    SELECTEDVALUE('Table'[Date])<TODAY(),
    "Green"
)
2. assign conditional formating to date column or any desired column and choose conditional formating type (i.e font color)
Irwan_1-1740016854379.png

3. choose Field in Format Style and select the measure made before.

Irwan_2-1740016925769.png

 

Hope this will help.

Thank you.

Chew_WenJie
Resolver III
Resolver III

Syndicated - Outbound

 

Hihi! 😊 You can create a simple measure like this:

 
Measure = IF(MAX('Table (2)'[Column3]) < TODAY(), 1, 0)

Then, apply conditional formatting to your date column, setting it to show green color based on the measure. You can refer to the example in the image for guidance. 🎨

Chew_WenJie_0-1740016666337.png

Hope it helps 

 

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)