Forum Discussion
Calculate dynamic average age by cuttoff date
- 8 years ago
Hi zxl1031,
The return value of "Format" function is text type, so you can't use "Format" function, you should modify your date like pattern
yyyy\MM\dd HH:mm:ss
And then click Modeling-> Date type to change text type to datetime.
Regards,
Jimmy Tao
Hi Jimmy,
Yes, I have converted the format of "resolve" column. But not working.
average outstanding age = CALCULATE(AVERAGEX(FILTER(ids,FORMAT(ids[created],"yyyy-mm-dd")<FORMAT(MAX(Dates[date]),"yyyy-mm-dd")&&FORMAT(ids[resolved],"yyyy-mm-yy")>FORMAT(MAX(Dates[date]),"yyyy-mm-dd")),DATEDIFF(ids[created],MAX(Dates[date]),DAY)))
Sorry about the typo in the above measure. It is:
average outstanding age = CALCULATE(AVERAGEX(FILTER(ids,FORMAT(ids[created],"yyyy-mm-dd")<FORMAT(MAX(Dates[date]),"yyyy-mm-dd")&&FORMAT(ids[resolved],"yyyy-mm-dd")>FORMAT(MAX(Dates[date]),"yyyy-mm-dd")),DATEDIFF(ids[created],MAX(Dates[date]),DAY)))
Hi zxl1031,
The return value of "Format" function is text type, so you can't use "Format" function, you should modify your date like pattern
yyyy\MM\dd HH:mm:ss
And then click Modeling-> Date type to change text type to datetime.
Regards,
Jimmy Tao