Okay, let's check this Power BI DAX logic step by step.
Variables:
VAR Today = TODAY(): Correctly gets the current date.
VAR IsComplete = [Completion%] = 1: This assumes your [Completion%] column is a decimal where 1 represents 100%. If [Completion%] is stored as a percentage (e.g., 100) or another format, this condition would need adjustment (e.g., [Completion%] = 100). Assuming [Completion%] is 0-1 decimal. This variable correctly checks if the task is completed.
VAR HasFutureRevisedDate = NOT(ISBLANK([RevisedDate])) && [RevisedDate] > Today: This correctly checks two things:
- Is there a
[RevisedDate]? (NOT(ISBLANK([RevisedDate])))
- If yes, is that
[RevisedDate] in the future? ([RevisedDate] > Today)
This variable correctly identifies if there's a future revised deadline.
VAR HasFutureFinishDate = [FinishDate] > Today: This correctly checks if the original [FinishDate] is in the future. Note that if [FinishDate] is blank, the comparison BLANK() > Today will typically evaluate to FALSE (or BLANK, which is treated as FALSE in a boolean context), which is the desired behavior – a blank finish date doesn't make it "Due" based on the original finish date criterion.
VAR IsDue = OR(HasFutureRevisedDate, HasFutureFinishDate): This checks if either the revised date is in the future or the original finish date is in the future. This variable correctly identifies if there is any future deadline associated with the task.
Return Logic (Nested IFs):
IF( IsComplete, "Completed", ... ): The first condition checks if IsComplete is TRUE. If a task is 100% complete, it is classified as "Completed", regardless of its dates. This is the standard and logical first check.
IF( IsDue, "Due", "Overdue" ): This nested IF is executed only if the task is not completed (IsComplete is FALSE).
- If
IsDue is TRUE (meaning there is a future deadline, either revised or original), it's classified as "Due".
- If
IsDue is FALSE (meaning there is no future deadline, i.e., both RevisedDate and FinishDate are in the past, today, or blank), it's classified as "Overdue".
Conclusion:
The logic is correct based on standard task status definitions:
- Completed tasks are identified first.
- For incomplete tasks, it checks if there is any future deadline (either the original Finish Date or a Revised Date). If yes, it's "Due".
- If there's no future deadline and the task is not complete, it's "Overdue".
Caveat:
The only potential point of failure or required clarification is the assumption that [Completion%] uses a decimal scale where 1 equals 100%. If your data model uses percentages (e.g., 100 for 100%), adjust [Completion%] = 1 accordingly (e.g., [Completion%] = 100).
Assuming [Completion%] is a 0-1 decimal, the logic is sound and correctly implements the desired task status categorization.