Hope all is well, i need some guidance on the power query Editor side. I am trying to calculate open days from Start Date to end date. I have created the query but, anything with no end date returns “null”.
I would like to the null to be replaced with current date: not sure how to get this fixed/
Create a new blank query and enter this code: Date.From( DateTime.FixedLocalNow() )
Disable load and Rename it something like: Today
Add an if statement to your open days calculation and perform a logical test on the [End date] something like: if ( [End date] = null and [Start date] <> null ) then Number.From( Today - [Start date]) else Number.From( [End date] - [Start date])
Replace the calculation with how you’d like to calculate that Day Difference
I hope this is helpful
Your Start- and End dates are of datetime datatype so the Today query also needs to return a datetime value. In short, entering DateTime.FixedLocalNow() is enough because that returns a datetime datatype.
Next I amended the logic for your Duration Days custom column.