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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.