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
Jamieneedshelp
Frequent Visitor

Conditional Formatting this month, next month and 2 months time

Hi

 

I have matrix table with a reference column and a next review due date coloumn

 

I would like to highlight those in the current month green, next month amber and those in 2 months time red based on the date column example below

 

Hoping someone could suggest a dax measure I could apply for the conditional formatting many thanks

IMG_20230822_215708.jpg

👍

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Try this dax:

FORMAT = SWITCH(MONTH(SELECTEDVALUE('Table'[Review Due Date])), 
    MONTH(TODAY()), "Green", 
    MONTH(TODAY()) + 1, "Orange", 
    MONTH(TODAY()) + 2, "Red"
)

vicky__0-1692744612356.png

 

View solution in original post

3 REPLIES 3
Undercoverstig
New Member

Hi, thank you with your help with this however we have just noticed it also highlights the months from previous years also. I.e today it formats Sept 2022, Sept 2023, Sept 2024

 

Is there any way to add month and year to this? 

 

Thank you

vicky_
Super User
Super User

Try this dax:

FORMAT = SWITCH(MONTH(SELECTEDVALUE('Table'[Review Due Date])), 
    MONTH(TODAY()), "Green", 
    MONTH(TODAY()) + 1, "Orange", 
    MONTH(TODAY()) + 2, "Red"
)

vicky__0-1692744612356.png

 

I attempted this solution, but the formatting is not working. Any suggestions?

I want anything before today's date to be red, anything this month orange, and next month, yellow. 

Grace_Pisarchuk_0-1723136402025.png

Grace_Pisarchuk_1-1723136455776.png

 

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

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

Sept NL Carousel

Fabric Community Update - September 2024

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