• Have a read of the following from Chris Webb:

    https://cwebbbi.wordpress.com/2011/03/24/last-ever-non-empty-a-new-fast-mdx-approach/

    You should be able to expand upon what is there and to what you need to.


    I'm on LinkedIn