Forum Discussion
mirzay
Helper I
11 years agoNew Column formula with IF no longer accepted
This was working yesterday but no longer today. I added a column that tells the difference between 2 dates. However, if a date is null, I would like to use today's date for that. This works in Po...
- 11 years ago
In the posted screen shot, you're in a Power Query/M context and not a DAX context. As such, the expression you actually want is probably something like this:
= if [ClosedDateTime] = null then Duration.TotalDays([ClosedDateTime] - [CreatedDateTime]) else Duration.TotalDays(DateTime.LocalNow() - [CreatedDateTime])
jeffrey_wang
Power BI Team
11 years agoCan you post the screen shot with the error or the error message text?