Unable to calculate median absolute deviation

I have a numerical column called average_usage and I want to create a calculated field called median absolute deviation. I tried this

median({average_usage} - avg({average_usage}))

But I get this error

Nesting of aggregate functions like PERCENTILECONT and PERCENTILE_CONT(50) WITHIN GROUP (ORDER BY “average_usage” - AVG(“average_usage”)) is not allowed.

How do I go about creating this calculation?

Hi @Morgan_Weiss,

Can you try avgOver with PRE_AGG instead of avg inside the median?

Hi @Morgan_Weiss,
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial post?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!

Hi @Morgan_Weiss,
Since we haven’t heard back, I’ll close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!