• Firstly, have a read of this article by Chris Webb about the performance of DateDiff: http://cwebbbi.wordpress.com/2014/06/09/calculating-ages-in-mdx/

    Secondly,

    It doesn't seem like you are doing anything that is particularly dynamic so, depending on your processing model, you may wish to take all of this:

    WITH MEMBER [Measures]. [CurrentDate] as 'NOW()'

    MEMBER DateDif as vba!datediff("d",[Invoice Sent Date].[Date] .currentmember.member_value,

    VBAMDX.Format(VBAMDX.Now(),"MM/dd/yy"))

    Member [DueBucket] as IIF (DateDif > 180, "Above 180",

    IIF(DateDif>120, "121-180",

    IIF(DateDif>90, "91-120",

    IIF(DateDif>60, "61-90",

    IIF(DateDif>30, "31-60",

    IIF(DateDif>=0, "0-30", "Not Due"))))))

    ...and make it into an expression in your fact table dsv. Then you could join it to a DueBucket dimension which would make it both much faster and more flexible for people browsing the cube.

    Again this second part depends on your processing model - for example this wouldn't work if you were processing your measure group incrementally. Have a read of the article though it should provide some pointers.


    I'm on LinkedIn