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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Userpath77
Helper II
Helper II

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!

1 ACCEPTED SOLUTION
Payeras_BI
Solution Sage
Solution Sage

Hi @Userpath77 ,

I believe SWITCH would help here.

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

Payeras_BI_1-1625154593496.png

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

2 REPLIES 2
Payeras_BI
Solution Sage
Solution Sage

Hi @Userpath77 ,

I believe SWITCH would help here.

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

Payeras_BI_1-1625154593496.png

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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