Re: How assign colors particular columns in pivot table
Not a real answer , but could you not move calculation of [Activity name] field to the script? You would save your self a lot of complexity when defining dimension, sorting, coloring, etc. Easier to maintain as well.
You could then just use simple expression (or calculated variable) in 'background' section.