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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Conditional Format Dates in a column based on Date in a previous column

Hello, 

 

Firstly I am very new to PowerBI. I have been searching for a solution the following and cannot find anything, I am wondering if it is even possible?

 

Conditional Format Dates in a column based on Date in a previous column

 

I have two columns, I want to Conditional format column 2 if the date is greater(later) than Column 1 - I will then repeat this for each column (month) in the report to show an easy to view trend of date changes. 

 

Any help much appreciated

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi JTurv,

You could try below suggestions:

My data sample

id t1 t2
1 1/1/2018 1/1/2019
2 5/1/2019 3/2/2019
3 6/1/2019 1/5/2019
4 4/5/2019 8/10/2019
5 6/15/2019 7/15/2019
6 5/18/2019 5/18/2019

Then I create a measure for conditional format

Measure 2 = if(MIN(comparetime[t2])>=MIN(comparetime[t1]), "#d6b3f2","#f4f7c3")

Set confidition format on ID like below

317.PNG

Best Regards,
Zoe Zhi

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

3 REPLIES 3
dax
Community Support
Community Support

Hi JTurv,

You could try below suggestions:

My data sample

id t1 t2
1 1/1/2018 1/1/2019
2 5/1/2019 3/2/2019
3 6/1/2019 1/5/2019
4 4/5/2019 8/10/2019
5 6/15/2019 7/15/2019
6 5/18/2019 5/18/2019

Then I create a measure for conditional format

Measure 2 = if(MIN(comparetime[t2])>=MIN(comparetime[t1]), "#d6b3f2","#f4f7c3")

Set confidition format on ID like below

317.PNG

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Thanks alot for this, exactly what I needed. 

 

The only issue is I have to create a new measure to check each month against last month, I imagine it may be too complicated to create a single measure that could be applied to all date columns that would always check this months date against last months date?

Anonymous
Not applicable

@dax Thank you for your help previously. 

 

Would there be any way to manipulate the code so that it checks each month against it's previous month in one measure? 

This would negate having to make new measures to compare each month. 

 

I have gone a slightly different route by having all my data in Matrix table

 

Matrix Table.jpg

 

My columns are essentially data capture dates (once a month), ordered by a sort order in the DataDateOrder_Lookup table. The values are the dates captured on those data dates. 

 

What I'm trying to achieve is assess the value (Date) in each column (DataDate) and flag red if the date is greater that the previous month.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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