cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
umershamshad
Frequent Visitor

Measure to display date in different colors based on specific rules.

I'm trying to create a measure which will display last refreshed date of Power BI dataset in different colors, with the following criteria:

  • Green, if last refreshed date = Today
  • Yellow, if last refreshed date = Today - 1 (Yesterday)
  • Red, if last refreshed date is before that

I've created the following measure:

 

LastRefresh =
VAR RefreshDate = MAX(LastRefreshed[LastRefreshedDate])
VAR TodayDate = MAX(LastRefreshed[Today])

RETURN
IF(
RefreshDate = TodayDate, "#00FF00",
IF(
RefreshDate = TodayDate - 1, "#FFFF00", "#FF0000"))
 
The table has only two fields:
umershamshad_0-1660201797781.png

 

This is the result I'm getting:

umershamshad_0-1660201966473.png

 

I want to display the date in  specific color instead of RGB code. Can someone help me?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User
1 REPLY 1
amitchandak
Super User
Super User

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors