Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

dateDiff in weekdays function

Hi there,    i've been using the following function to calculate the date difference in weekdays between 2 columns (creationDate, closureDate);   = (InitialDate as date, FinalDate as date ) as nu...
  • ChrisClever's avatar
    ChrisClever
    4 years ago

    Ok,

    So the problem here is the null value in the FinalDate Column. The easy fix would be to replace the nulls with the current date before adding the custom function column. And then your code should be working just fine.

    #"Replace Value" = Table.ReplaceValue(#"Changed type",null,Date.From(DateTime.LocalNow()),Replacer.ReplaceValue,{"Final Date"})