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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

2 REPLIES 2
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

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors