Use a measure:
let
ValidDates = FinalDate <> null and InitialDate <> null,
InitialDate = if InitialDate = null then DateTime.LocalNow() else InitialDate,
FinalDate = if FinalDate = null then DateTime.LocalNow() else FinalDate,
DaysBetweenDates = if ValidDates then Duration.Days(FinalDate-InitialDate) else 0,
...
WorkingDays =if ValidDates then (if DaysBetweenDates < 0 then -1 else 1) * List.Count(WeekDaysList) else null
in
Check the power bi training provided by intellipaat
Also, check out our YouTube video to know the fundaments of Power BI and more