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
Jason_Auburn
Helper I
Helper I

Conditional Form at date that occurred in past 30 days

Hello

 

I would like to fill a cell within a table if a date is present that occurred within the past 30 days as green and if it's more than 30 days fill with red. 

 

The column is called 'Incidents'[IN Last Comment], I understand this will need a measure to be created then added as conditional formatting?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jason_Auburn 

You can create a measure

e.g 

Format = var a=DATEDIFF(SELECTEDVALUE('Incidents'[Date]),TODAY(),DAY)
return IF(a>0&&a<=30,"green","red")

Then put it to the conditional formatting of the [in last comment] field

vxinruzhumsft_0-1694498728635.png

Output

vxinruzhumsft_1-1694498739485.png

 

Best Regards!

Yolo Zhu

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Jason_Auburn 

You can create a measure

e.g 

Format = var a=DATEDIFF(SELECTEDVALUE('Incidents'[Date]),TODAY(),DAY)
return IF(a>0&&a<=30,"green","red")

Then put it to the conditional formatting of the [in last comment] field

vxinruzhumsft_0-1694498728635.png

Output

vxinruzhumsft_1-1694498739485.png

 

Best Regards!

Yolo Zhu

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

 

chonchar
Helper V
Helper V

Yes. Put that measure in a visual, then:

Click that little FX

 


 Updating Media

 

chonchar_0-1694100908857.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors