Good Morning.
I have a problem in building a query in mdx with respect to calculating days in the time dimension. In the current period of the query (and the parallel of the previous year) are calculated well, but for the sum of several periods always appears 0. Other measures are well calculated when adding several periods, but time always appears 0. The query that I do is as follows:



WITH
SET [~COLUMNS] AS {[Tiempo Estancia.Tiempo].[2017].[2],PARALLELPERIOD([Tiempo Estancia.Tiempo].[Año],1,[Tiempo Estancia.Tiempo].[2017].[2]), [Tiempo Estancia.Tiempo].[AcumActual]}
SET [~ROWS] AS {[Estructura Funcional.EstructuraFuncional].[Especialidad].members}
MEMBER [Tiempo Estancia.Tiempo].[AcumActual] AS '[Tiempo Estancia.Tiempo].[2017].[1] + [Tiempo Estancia.Tiempo].[2017].[2]'
MEMBER [Measures].[Dias] AS [Tiempo Estancia.Tiempo].CurrentMember.Children.Count
SELECT
NON EMPTY [~COLUMNS] ON COLUMNS,
NON EMPTY CrossJoin([~ROWS], {[Measures].[Dias]}) ON ROWS
FROM [Hospitalizacion]