## Conditional Calculated Measures

 Author Message Michael French Right there with Babe Group: General Forum Members Points: 728 Visits: 624 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.`with member [Measures].[Monthly Adjusted Cost] as CASE WHEN StrToVal([Calendar].[YearMonthLabel].CurrentMember.Name) < 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]`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 Mackers SSCommitted Group: General Forum Members Points: 1737 Visits: 499 Try something like:with member [Measures].[Monthly Adjusted Cost] as IIF(Exists([Calendar].[YearMonthLabel].CurrentMember, {null:[Calendar].[YearMonthLabel].&[201101]}).COUNT > 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]It may be simpler to add a scope statement in your cube rather than doing a calcscope {null:[Calendar].[YearMonthLabel].&[201101]};[Measures].[Cost AMT] = [Measures].[Cost AMT]*0.95;end scope;