﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Data Warehousing / Analysis Services  / Conditional Calculated Measures / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 14:08:21 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Conditional Calculated Measures</title><link>http://www.sqlservercentral.com/Forums/Topic1378996-17-1.aspx</link><description>Try something like:[size="1"]with member [Measures].[Monthly Adjusted Cost] as IIF(Exists([Calendar].[YearMonthLabel].CurrentMember, {null:[Calendar].[YearMonthLabel].&amp;[201101]}).COUNT &amp;gt; 0, [Measures].[Cost AMT]*0.95, [Measures].[Cost AMT])select non empty [Calendar].[YearMonthLabel].[YearMonthLabel].Members on rows, {[Measures].[Cost AMT], [Measures].[Monthly Adjusted Cost]} on columns from [CostCube][/size]It may be simpler to add a scope statement in your cube rather than doing a calc[size="1"]scope {null:[Calendar].[YearMonthLabel].&amp;[201101]};[Measures].[Cost AMT] = [Measures].[Cost AMT]*0.95;end scope;[/size]</description><pubDate>Wed, 31 Oct 2012 07:51:37 GMT</pubDate><dc:creator>Mackers</dc:creator></item><item><title>Conditional Calculated Measures</title><link>http://www.sqlservercentral.com/Forums/Topic1378996-17-1.aspx</link><description>I am having an issue trying to add some conditional logic to a calculated measure. What I am trying to do is to account for a change in view formula prior to a certain date. The below MDX query produces the desired results.[code="other"]with member [Measures].[Monthly Adjusted Cost] as CASE     WHEN StrToVal([Calendar].[YearMonthLabel].CurrentMember.Name) &amp;lt; 201101     THEN [Measures].[Cost AMT]*0.95    ELSE [Measures].[Cost AMT]ENDselect non empty [Calendar].[YearMonthLabel].[YearMonthLabel].Members on rows, {[Measures].[Cost AMT], [Measures].[Monthly Adjusted Cost]} on columns from [CostCube][/code]The question then becomes how to put the case statement into the actual Cube definition from the Calculations tab of the Cube Design for CostCube in Visual Studio. The forms that I have been trying end up with #value error saying I have an empty MDX Expression. The cube builds and does not produce an error.Please, let me know if anyone knows how best to do this.Thank you</description><pubDate>Tue, 30 Oct 2012 13:37:54 GMT</pubDate><dc:creator>michael.french 172</dc:creator></item></channel></rss>