Thank you Sunny both options worked! Does this mean only aggregated type formulas work in the dimension?
I have a more complex example where I am generating a recency score by customer. The formula works below in a measure within a table by customer. Although when I try to use the recency score as a dimension it does not work.