I have this set followed by the two calculated members:

SET [Periodo] as '{ Descendants ( [Periods].[EKT].[All Periods].[2004], [Periods].[EKT].[Week] , self) }'

MEMBER TypeInfo.set_days AS
Count (

Descendants( [Periods].[EKT].currentmember , [Periodos].[EKT].[Date] , self),
Not IsEmpty([Measures].currentmember)


MEMBER [TipoInfo].[AVG] as 'IIF( set_days = 0, ( [TypeInfo].[Generado], [Periodos].[EKT].currentmember ), [TipoInfo].[Generado] / set_days )'

When I use the calculated member I get #ERR cells with description:

Infinite recursion detected during execution of calculated member set_days,

My goal is get average, but I don't understand what's the problem, maybe because I'm a newbie in MDX . I tried de avg function, transforming tha MEMBER TypeInfo.set_days in a Set but...with the same error.

Thank you, and sorry my English!