How to add Standard Deviation to the Y-axis?
Let’s say you have the stock price of [Tesla] on the Y-axis and time on the X-axis. You want to add an additional axis that shows the Standard Deviation (a.k.a. volatility in finance) for the last 30 days. How can you achieve that?
The following function calculates the Standard Deviation of [Tesla] for the last 30 days:
WINDOW_STEDV(SUM([Tesla], -30,0)). Now I add this Calculated Field (function) as a Dual Axis (Y-axis on the right). Ideally, I display the standard deviation is percentages.
The standard deviation is displayed on a Dual Axis.
Having the standard deviation on the Y-axis allows me to create an email alert (e.g. send an email alert if standard deviation >32%).
PS: Not long ago, that was an interview question for a Tableau project.