Forum Discussion

mirzay's avatar
mirzay
Icon for Helper I rankHelper I
11 years ago
Solved

New 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...
  • curth's avatar
    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])