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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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