How to calculate the sales during the first 6 months after accounts created

@Mike,

Take a look at this and see if it works for you. Just created two measures, the first using DATEADD to step the sales date back by six months, the second filtering total sales by Cust Start Date >= the date created in the first measure.

image

SalesDate Minus 6Mo =

CALCULATE(
    SELECTEDVALUE( Sales[SalesDate] ),
    DATEADD(
        'Date'[Date],
        -6,
        MONTH
    )
)

Total Sales within 6Mo of Cust Start Date = 

CALCULATE(
    [Total Sales],
    FILTER(
        customer,
        customer[BusinessStartDate] >= [SalesDate Minus 6Mo]
    )
)

I hope this is helpful. Full solution file attached.

P.S. Your date table looks a little sad. If you’re going to be doing any significant time intelligence work with this data, I definitely recommend you give it a massive upgrade and switch over to @Melissa’s Extended Date Table.

2 Likes