Posts

Showing posts with the label mdx

MDX Scope Total Calculation with condition

MDX Scope Total Calculation with condition I recently encounter an issue with using scope to calculate grand total. Example I've create a measure : CREATE MEMBER CURRENTCUBE.[Measures].[test Invoice 2 Amt] AS IIF(ISEMPTY([Measures].[Amount]), NULL, [Measures].[SalesInvoiceLine2_Amt]), FORMAT_STRING = "#,#.00", VISIBLE = 1; This measure to ensure amount2 (SalesInvoiceLine2_Amt) only appear when another measure (Amount) have value. But now the issue is my grand total for Amount2 doesn't total based on above condition, instead it sum up all amount2. I've try to use scope but seems doesnt work as well. CREATE MEMBER CURRENTCUBE.[Measures].[test Invoice 2 Amt] AS IIF(ISEMPTY([Measures].[Amount]), NULL, [Measures].[SalesInvoiceLine2_Amt]), FORMAT_STRING = "#,#.00", VISIBLE = 1; SCOPE ( [Measures].[test Invoice 2 Amt] ); THIS = SUM(IIF(ISEMPTY([Measures].[Amount]), NULL, [Measures].[SalesInvoiceLine2_Amt])) ; End Scope; [Item] [Amount] [test Invoice 2 Amt] [...