I am attempting to calculate the average completion time for a group of activities in an indicator element for a dashboard. I have a filtered dataset from our asset management system (Cityworks) in AGOL and have fields that report the start_time/completion_time. I want to calculate the average time it took to complete all the activities in the dataset. I referenced the solution found here, but keep getting errors that I cannot resolve. Here is what I have tested so far, unsuccessfully.

When I test this within the Dashboard element, I get the following error(s).
