Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Bradley Schacht

Bradley is a consultant at Pragmatic Works in Jacksonville, FL. He was an author on the book SharePoint 2010 Business Intelligence 24-Hour Trainer and tech edited the SQL 2011 Bible. His experience on the Microsoft BI platform includes DTS, SSIS, SSRS, SSAS and migrations and conversions. He has helped numerous companies in successfully developing and implementing new business intelligence solutions into their organizations. Bradley also participates as a speaker in community events like SQL Saturday, Code Camp, SQL Lunch and SQL Server User Groups. He is a contributor on sites such as and SQL Server Central as well as an active member of the Jacksonville SQL Server User Group (JSSUG).

Color Expressions in SSAS Calculations

Color expressions in SSAS allow you to build an MDX expression to control the color of text displayed in a calculation. This property can be found in the Calculations tab of the cube editor when working in BIDS. Simply select a calcuation and look for the section labeled Color Expressions between the Display Folder and Font Expressions in the Additional Properties.

Simply enter a condition in the box as shown above when the results of the condition being the colors you would like the text to be. There is even a little color picker to the right of the expression box that will help you get the right code for the color you choose. The format is:

IIF([Measures].[MeasureNameEvaluation Expressions, True Result, Else Result)

For instance, IIF([Measures].[Internet Average Sales Amount] > 750, 32768, 0)

This translates to If the measure Internet Average Sales amount is greater than $750 then make the text green, otherwise keep it black. You can nest statements and create some pretty complex conditions here, but I’ll leave that up to each of you to explore.

When we browse the cube you will now notice that the values for that measure over $750 appear green while everything else is in black. One nice thing is that this carries over into Excel. So when a user browses in an environment they are familiar with they will be able to take advantage of your color expressions without any additional work!

We can now see that for our sales territories in the United States the Northwest and Southwest regions are above the threshold. North America as a whole is also overall above average. Everyone else is behind the curve ball and still shows up in plain black text.

Unfortunately this does not carry over to SSRS, but the same functionality can be created with an expressions on the text box.


Leave a comment on the original post [, opens in a new window]

Loading comments...