Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
= 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.
= 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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |