I would like to use a formula to calculate the mean of a measure that is plotted on a bar/line view. The measure is split by category and using subset formulas only calculates the mean by split.
Is there any way to calculate the total mean independent of split and plot it on the same axis? See screenshot attached for a better explanation.
Yes, but only using some fairly obscure techniques.
We plan on introducing guidelines to the Bar/line view, similar to those in the Graph view.
Until then, depending on your view, you may be able to use the Graph view instead of the Bar view. Or, use the following "hack":
- Add a formula field which calculates the guideline value SUBSET_MEAN([field]) - In the view aggregation menu, aggregate by a field that is completely unique. For the formula, choose "(formula result)". For all other fields, choose "Singleton", "Sum" or "Mean". This trick ensures the formula recalculates as you filter. - Now configure a line measure for that formula field.