Printed 2015/10/05 06:30PM

MDX - Color Formatting on All Measures at Once


In a post a while back I wrote about how you can create conditional color formatting on the Analysis Services measures you create.  Recently I found a way to apply this same color formatting to all your measures.  Why would you want this?  Well let's say you want to all measures that have a value of less than 0 to show red to draw attention to negative numbers. 

To do this you will create a SCOPE statement.  You do this on the calculation tab of the by selecting a Script Command and using the following MDX.

SCOPE ([Measures].allmembers); 

    FORE_COLOR(THIS) = IIF([Measures].currentmember <0 ,'255','0'); 


It does matter what order code appears in the calculation list and so make sure this is on the very bottom to apply to all calculations.  Next time you drag in any calculation or measure and it's value is less than 0 it will show red to your users.


Copyright © 2002-2015 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.