Forum Discussion
Date difference blank
Hi,
I would like to calculate the number of days between two dates in a column.
I have now solved this:
= Duration.Days([M2.A Forecast Date] - [M1 Forecast Date])
But how can I add that this is only calculated if none of the dates is empty? Then I would also like an empty cell.
Can someone maybe help me with this?
Thanks a lot!
Nobody
Try the following formula as you are using Power Query:
if [M2.A Forecast Date] = null or [M1 Forecast Date] = null then null else Duration.Days([M2.A Forecast Date] - [M1 Forecast Date])
4 Replies
- themistoklisCommunity Champion
Try the following formula as you are using Power Query:
if [M2.A Forecast Date] = null or [M1 Forecast Date] = null then null else Duration.Days([M2.A Forecast Date] - [M1 Forecast Date])
- Nobody1292Regular Visitor
thank you, it works 🙂
- AnonymousNot applicable
HI
Pleasr try :
if(or(ISBLANK(SELECTEDVALUE([M2.A Forecast Date])),ISBLANK(SELECTEDVALUE([M1 Forecast Date]))),,Duration.Days([M2.A Forecast Date] - [M1 Forecast Date])) - speedrampsSuper User
Hi Nobody
We want to help you but it looks like you asked this question in a rush.
It does not make sense. "how can I add that this is only calculated if none of the dates is empty" ☹️
Please take time to write questions clearly and you will get quicker answers. Thanks 😀