Forum Discussion

CG_FinXO's avatar
CG_FinXO
Regular Visitor
3 years ago
Solved

Changing Card Colour based on Date Condition

Hello,   I'm relatively new to Power BI and am looking to create a rule that changes the colour of a card in power BI, if the value is over x age (for example if the date/ time value is over 1 week...
  • Dhairya's avatar
    Dhairya
    3 years ago

    IsWithinLast7Days = IF(MAX('YourTable'[DateColumn]) >= TODAY() - 7 && MAX('YourTable'[DateColumn]) <= TODAY(), "1", "0")

    Use above measure for conditional formatting and set rules for same
    if measure value is 1 then set color to red, similarly for 0.