Forum Discussion

Userpath77's avatar
Userpath77
Helper II
5 years ago
Solved

Conditional Formatting (2 Rules for same column)

Hello All

I have these two DAX measures. I basically need to color one column two different colors (Red if date in other column is within 45 days and Yellow if within 60 days. I will need the 45 day rule to have higher precedent so that it overrides the 60 day Yellow when the appropriate time comes.

Does anyone know how to nest these two statements together and give the 45 day higher precedent?

 

45_Day_Color = if(FIRSTNONBLANK(Elig_List[45_Day_Alert],TODAY()) <today(),"red","white")

60_Day_Color = if(FIRSTNONBLANK(Elig_List[60_Day_Alert],TODAY()) <today(),"yellow","white")

I appreciate any help!

  • Hi Userpath77 ,

    I believe SWITCH would help here.

    MEASURE = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[ColumnWithDate])-TODAY()<45,
        "RED",
        SELECTEDVALUE('Table'[ColumnWithDate])-TODAY()<60,
        "YELLOW",
        "WHITE"
    )
    
    

     

2 Replies

  • Hi Userpath77 ,

    I believe SWITCH would help here.

    MEASURE = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[ColumnWithDate])-TODAY()<45,
        "RED",
        SELECTEDVALUE('Table'[ColumnWithDate])-TODAY()<60,
        "YELLOW",
        "WHITE"
    )
    
    

     

    • Userpath77's avatar
      Userpath77
      Helper II

      Thanks Payeras-----I had to adjust it a little, but worked perfect! Thanks again.