Forum Discussion
jcastr02
5 years agoPost Prodigy
Power query if formula
Can you help with a formula that would do the following in power query:
1. If the "Term Date" is blank then (Today()-HireDate)
If not blank
2. TermDate-HireDate
Appreciate any help
= Table.AddColumn(PreviousStepName, "Days", each if [TermDate]=null then Duration.Days(Date.From(DateTime.LocalNow())-[HireDate]) else Duration.Days([TermDate]-[HireDate]), Int64.Type)It is assumed that [TermDate] & [HireDate] columns are of type date.
1 Reply
- JakintaSolution Sage
= Table.AddColumn(PreviousStepName, "Days", each if [TermDate]=null then Duration.Days(Date.From(DateTime.LocalNow())-[HireDate]) else Duration.Days([TermDate]-[HireDate]), Int64.Type)It is assumed that [TermDate] & [HireDate] columns are of type date.