Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Credo
Helper I
Helper I

New Product Sales for first 3 month

Cant seem to figure this out 

 

I have a simple sales table 

 

Date of sale / Product name / Sales

 

I need to keep track of sales for new products for 3 months. So if a product first began selling on January 1st than I need to track it until April 1st. 

 

How can I do this?

 

Thanks for your help! 

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Credo,

 

Please refer to below DAX to new calculated columns.

first sale time =
CALCULATE (
    MIN ( table5[Date of sale] ),
    ALLEXCEPT ( table5, table5[Product name] )
)

3 months later =
DATEADD ( table5[first sale time].[Date], 3, MONTH )

Sum sales =
CALCULATE (
    SUM ( table5[Sales] ),
    FILTER (
        ALLEXCEPT ( table5, table5[Product name] ),
        table5[Date of sale] >= table5[first sale time]
            && table5[Date of sale] < table5[3 months later]
    )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @Credo,

 

Please refer to below DAX to new calculated columns.

first sale time =
CALCULATE (
    MIN ( table5[Date of sale] ),
    ALLEXCEPT ( table5, table5[Product name] )
)

3 months later =
DATEADD ( table5[first sale time].[Date], 3, MONTH )

Sum sales =
CALCULATE (
    SUM ( table5[Sales] ),
    FILTER (
        ALLEXCEPT ( table5, table5[Product name] ),
        table5[Date of sale] >= table5[first sale time]
            && table5[Date of sale] < table5[3 months later]
    )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.