Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Solved! Go to Solution.
Hi @MikeHunt
@Ahmedx Thank you very much for your prompt reply!
When I was checking the posts in our community, I found your post. May I ask if your issue has been resolved? If not, here I have provided an alternative code logic, please refer to the following method:
Here's some dummy data
“Table”
Create a measure.
MEASURE =
VAR _Diff = DATEDIFF(SELECTEDVALUE('Table'[NextRevision]), TODAY(), DAY)
RETURN
SWITCH(
TRUE,
_Diff <= 0, "Overdue",
0 < _Diff && _Diff <= 30, "Less than 30 days",
30 < _Diff && _Diff <= 60, "Less than 60 days",
60 < _Diff && _Diff <= 90, "Less than 90 days",
"In Compliance"
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MikeHunt
@Ahmedx Thank you very much for your prompt reply!
When I was checking the posts in our community, I found your post. May I ask if your issue has been resolved? If not, here I have provided an alternative code logic, please refer to the following method:
Here's some dummy data
“Table”
Create a measure.
MEASURE =
VAR _Diff = DATEDIFF(SELECTEDVALUE('Table'[NextRevision]), TODAY(), DAY)
RETURN
SWITCH(
TRUE,
_Diff <= 0, "Overdue",
0 < _Diff && _Diff <= 30, "Less than 30 days",
30 < _Diff && _Diff <= 60, "Less than 60 days",
60 < _Diff && _Diff <= 90, "Less than 90 days",
"In Compliance"
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pls try this code
Due Date =
VAR _Diff = DATEDIFF( TODAY(),tbl_Materials[NextRevision] ,DAY)
RETURN
SWITCH(TRUE,
_Diff <= 0 "Overdue",
_Diff <= 30, "Less than 30 days",
_Diff <= 60, "Less than 60 days",
_Diff <= 90, "Less than 90 days",
"In Compliance"
)
===== or ===
MEASURE =
VAR _Diff = DATEDIFF(TODAY(),MAX(tbl_Materials[NextRevision] ) ,DAY)
RETURN
SWITCH(TRUE,
_Diff <= 0 "Overdue",
_Diff <= 30, "Less than 30 days",
_Diff <= 60, "Less than 60 days",
_Diff <= 90, "Less than 90 days",
"In Compliance"
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!