Forum Discussion
Calculating Days Between a Date and Today
- 9 years ago
Yes, it will likely return negative INT value for today's date, if there are blanks.
You can nest the function in IF() function to return blank if [Due Date] is blank.
=IF(ISBLANK('Account Planning'[Due Date]),BLANK(),INT('Account Planning'[Due Date]-'Account Planning'[TodayCol]))
Try using...
=INT('Account Planning'[Due Date]-'Account Planning'[TodayCol])
Also, instead of using DATE() & NOW() for Today column. You can just use TODAY().
EDIT: If above doesn't fix it. Try first converting each of date column to integer using INT(COLUMN).
If the value does not fall in range of 42736 to 43100 for year 2017. Then there's something off with your date column(s).
- Rsanjuan9 years ago
Advocate III
Thanks. For some reason, it's not working for me. There are some rows that have a "null" in the Due Date field. Will that cause it?
- Chihiro9 years ago
Solution Sage
Yes, it will likely return negative INT value for today's date, if there are blanks.
You can nest the function in IF() function to return blank if [Due Date] is blank.
=IF(ISBLANK('Account Planning'[Due Date]),BLANK(),INT('Account Planning'[Due Date]-'Account Planning'[TodayCol]))