Forum Discussion
Anonymous
1 year agoNot applicable
Date calculations fail for some date column
I have the following measure that works if I choose 'NC Main'[NC Completed Date] yet fails when I substitute 'NC Main'[NC Created Date]. The Created Date field just produces (BLANK). The two columns ...
- 1 year ago
Do you have a separate Calendar Table by a chance? If yes, by which date is it linked to your fact table?
rit_ty7
Advocate I
1 year agoAnonymous Hello,
Maybe try the below code:
__TestAged =
VAR MaxDate = CALCULATE(MAX('datekey'[date]))
RETURN
IF(
[__TestStatus] = "open" &&
[__Test Created in RP] = "Valid" &&
NOT ISBLANK('NC Main'[NC Created Date]) &&
DATEDIFF('NC Main'[NC Created Date], MaxDate, DAY) > 60,
"aged",
"not aged"
)
where,
NOT ISBLANK('NC Main'[NC Created Date]): Prevents errors caused by blank dates