Sales of First N Periods by Dimension

Version 3

    Description:

     

    Re: Sum first 12 months only

     

    Calculation utilizes 2 Parameters and an LoD to compute the Sales for the First N Periods. Both N and Periods are adjustable via Parameters.

     

    In addition the Calc uses { INCLUDE : } as opposed to FIXED, so that the Dimensions can added, or rotated at will

     

    9-21-2015 4-24-54 PM.png

     

    9-21-2015 4-25-43 PM.png

     

     

    Example Calculation:

     

    Period Parameter =>

     

    9-21-2015 4-26-33 PM.png

     

    First N Periods = >

     

    9-21-2015 4-27-12 PM.png

     

    Sales of First N Periods =>

     

    IF DATEDIFF([Period], { INCLUDE : MIN([Order Date]) }, [Order Date])

    < [First N Periods]

    THEN [Sales]

    END

     

    Additional Note*

     

    This can also be expanded by adding a First/Last parameter to control whether or not the User wants to See the First/Last N Period Sales by Dimension

     

    9-21-2015 5-03-35 PM.png

     

     

    IIF([First/Last] = 'First',

        IF DATEDIFF([Period], { INCLUDE : MIN([Order Date])}, [Order Date])

        < [N Periods]

        THEN [Sales]

        END

    ,

        IF DATEDIFF([Period], [Order Date], { INCLUDE : MAX([Order Date]) })

        < [N Periods]

        THEN [Sales]

        END

    )

     

    9-21-2015 5-04-27 PM.png