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.
Hello guys!
I need help in adding status to dates.
For example the screenshot below, if it's beyond the due date, it will show as Overdue in the Status column. If it's 5 days before the due date, it'll say Almost due and if it's beyond 5 days before the due date, it'll say On time.
Solved! Go to Solution.
Hi @swaggerboy69,
What type of result that you want to return if the current date is blank? Perhaps you can try this one and replace the 'N/A' with the result you wanted:
Due Status =
VAR _diff =
DATEDIFF ( TODAY (), 'CR_Dashboard'[Due date], DAY )
RETURN
IF (
'CR_Dashboard'[Due date] <> BLANK (),
IF ( _diff < 0, "Overdue", IF ( _diff < 5, "Almost Due", "On time" ) ),
"N/A"
)
Regards,
Xiaoxin Sheng
Can anyone help me with this please?
@swaggerboy69 , Try a new column like
new column =
var _diff = datediff([Date], today(),day)
return
switch(true(),
_diff<0 , "Overdue",
_diff<5 , "Almost Due",
"On Time"
)
There's inaccuracy of the data using that query.
I'm seeing October 28 as Almost due. It should be Overdue.
Also seeing October 31 as On Time. It should be Almost Due.
Additionally, if the Due date is blank, is there a way that it will retain as blank in the status?
Currently, it's saying Almost complete on blank Due dates.
HI @swaggerboy69,
Your table seems stored random dates with irregular value fields. Any available category and index use to filter records and find out the previous/next date based on current row contents?
In addition, it seems like your task code contains some numerical value that can work as index.
You can try to extract it and use it to find out the previous or next record, then you can calculate the diff between these and use if statement to mark and return tags.
Regards,
Xiaoxin Sheng
I was able to get it to work using the Query below:
Hi @swaggerboy69,
What type of result that you want to return if the current date is blank? Perhaps you can try this one and replace the 'N/A' with the result you wanted:
Due Status =
VAR _diff =
DATEDIFF ( TODAY (), 'CR_Dashboard'[Due date], DAY )
RETURN
IF (
'CR_Dashboard'[Due date] <> BLANK (),
IF ( _diff < 0, "Overdue", IF ( _diff < 5, "Almost Due", "On time" ) ),
"N/A"
)
Regards,
Xiaoxin Sheng
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |