SSAS Set Colour of Non-Calculated MeasuresOctober 25th, 2011 | Posted by in Analysis Services
Recently I had a requirement to set the colour of a couple of non-calculated measures in Analysis Services to differentiate between an actual and inferred value. It was another one of those things that I’d remembered being as simple as selecting a value from the properties screen… Unfortunately my memory deceives me and I was greeted with a properties window totally devoid of any colour settings!
Conveniently it’s easy (enough) to set the colours using MDX in the cube calculation script. SSAS defines colour values using a somewhat strange system, there’s a great post from Boyan Penev explaining this – Colour Codes in SSAS.
To set the colour of the Amount measure in the Adventure Works cube to a lovely shade of pink, you’d add the following line to the cube calculation script…
FORE_COLOR ( [Measures].[Amount] ) = 16711935;
With the resulting err… lovely pink measure when browsed from Management Studio.