Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I currently have a measure created to highlight the date in a table if it's within the next 60 days YELLOW, but it also included today.
What I'd like to do, and can't figure out, is how to make it so that if the date in the column is today's date or before today's date, change the highlight to GREEN, and keep the dates within the next 60 days to stay YELLOW. Anything past 60 days in the future will have no highlight.
Below is my current measure:
Solved! Go to Solution.
Please try the measure below:
Open Color =
VAR _Date = MAX ( 'Current'[Current OTP] )
VAR _Today = TODAY ()
RETURN
SWITCH (
TRUE (),
_Date <= _Today, "#92D050",
_Date <= _Today + 60, "#FFFF99",
BLANK ()
)
Give this a try
Date Highlight =
VAR TargetDate = SELECTEDVALUE('YourTable'[YourDateColumn])
VAR TodayDate = TODAY()
RETURN
SWITCH(
TRUE(),
TargetDate <= TodayDate, "#00FF00", -- GREEN
TargetDate > TodayDate && TargetDate <= TodayDate + 60, "#FFFF00", -- YELLOW
BLANK()
)
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
Please try the measure below:
Open Color =
VAR _Date = MAX ( 'Current'[Current OTP] )
VAR _Today = TODAY ()
RETURN
SWITCH (
TRUE (),
_Date <= _Today, "#92D050",
_Date <= _Today + 60, "#FFFF99",
BLANK ()
)
Worked like a charm. Thank you!!
Open Color =
var _datediff=DATEDIFF(MAX('Current'[Current OTP]),TODAY(),DAY)
return SWITCH(TRUE(),
_datediff>60,BLANK(),
_datediff>0,"yellow",
_datediff>-60,"green"
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |