Nov 30 2018 08:35 AM
How can I calculate a duration in column formatting?
With calculated columns, I can calculate a duration in days by subtracting two dates. For example if Start is 9/2/2018 and End is 1/31/2019, End-Start returns 151.
With column formatting, End-Start returns 5/31/1970.
I understand that I could use both the calculated column and column formatting, but I'd rather do it in one shot. My formatting involves multiple calculations.
Nov 30 2018 09:01 AM - edited Nov 30 2018 09:02 AM
Nov 30 2018 09:01 AM - edited Nov 30 2018 09:02 AM
SolutionI found a solution with the help of another thread.
The Number() operator converts a date into millisaconds. So the formula I came up with in column formatting is:
"=(Number([$End])-Number([$Start]))/1000/60/60/24"
Nov 30 2018 09:01 AM - edited Nov 30 2018 09:02 AM
Nov 30 2018 09:01 AM - edited Nov 30 2018 09:02 AM
SolutionI found a solution with the help of another thread.
The Number() operator converts a date into millisaconds. So the formula I came up with in column formatting is:
"=(Number([$End])-Number([$Start]))/1000/60/60/24"