Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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"
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
139 | |
104 | |
104 | |
80 | |
66 |