cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Comparing sales on different launch dates

Hi,

 

I want to compare products launched on products that have been launched on different dates and show the sales the first 16 weeks in a chart. I've identified the launch date with a "firstnonblank" dax code, but now I have no idea how I can go on from there. 

 

Somehow I need to set the time period prior the launch data to the first entry on the x-axis and then the launch date to the next and so on...

 

Please help!

 

Br Kent

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Eric_Zhang
Moderator

Re: Comparing sales on different launch dates


@Anonymous wrote:

Hi,

 

I want to compare products launched on products that have been launched on different dates and show the sales the first 16 weeks in a chart. I've identified the launch date with a "firstnonblank" dax code, but now I have no idea how I can go on from there. 

 

Somehow I need to set the time period prior the launch data to the first entry on the x-axis and then the launch date to the next and so on...

 

Please help!

 

Br Kent


@Anonymous

You may need a calendar table as below.

dimdate =
VAR Tbl =
    ADDCOLUMNS (
        CALENDAR ( "2016-01-01", "2017-12-31" ),
        "WeekInYear", CONCATENATE ( YEAR ( [Date] ), RIGHT ( "0" & WEEKNUM ( [Date] ), 2 ) )
    )
RETURN
    ADDCOLUMNS ( Tbl, "WeekNoOverYears", RANKX ( Tbl, [WeekInYear],, ASC, DENSE ) )

Capture.PNG

 

Then connect your products(launch date) table to this calendar table(date). To calculate the first 16 weeks sales after launch, use a measure as 

 

sales =
VAR LaunchWeekNo =
    MIN ( 'dimdate'[WeekNoOverYears] )
VAR TargetWeekNo = LaunchWeekNo + 15
RETURN
    CALCULATE (
        SUM ( 'sales table'[sales] ),
        FILTER (
            'sales table',
            'sales table'[sales date] >= MIN ( 'products table'[launch date] )
                && 'sales table'[sales date]
                    <= MAXX (
                        FILTER ( ALL ( 'dimdate' ), 'dimdate'[WeekNoOverYears] = TargetWeekNo ),
                        'dimdate'[date]
                    )
        )
    )

 

2 REPLIES 2
CheenuSing Super Contributor
Super Contributor

Re: Comparing sales on different launch dates

Hi @Anonymous

 

Can you post some sample data in excel file and share the link.  Also what is thee final char t/ output you except.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
Moderator Eric_Zhang
Moderator

Re: Comparing sales on different launch dates


@Anonymous wrote:

Hi,

 

I want to compare products launched on products that have been launched on different dates and show the sales the first 16 weeks in a chart. I've identified the launch date with a "firstnonblank" dax code, but now I have no idea how I can go on from there. 

 

Somehow I need to set the time period prior the launch data to the first entry on the x-axis and then the launch date to the next and so on...

 

Please help!

 

Br Kent


@Anonymous

You may need a calendar table as below.

dimdate =
VAR Tbl =
    ADDCOLUMNS (
        CALENDAR ( "2016-01-01", "2017-12-31" ),
        "WeekInYear", CONCATENATE ( YEAR ( [Date] ), RIGHT ( "0" & WEEKNUM ( [Date] ), 2 ) )
    )
RETURN
    ADDCOLUMNS ( Tbl, "WeekNoOverYears", RANKX ( Tbl, [WeekInYear],, ASC, DENSE ) )

Capture.PNG

 

Then connect your products(launch date) table to this calendar table(date). To calculate the first 16 weeks sales after launch, use a measure as 

 

sales =
VAR LaunchWeekNo =
    MIN ( 'dimdate'[WeekNoOverYears] )
VAR TargetWeekNo = LaunchWeekNo + 15
RETURN
    CALCULATE (
        SUM ( 'sales table'[sales] ),
        FILTER (
            'sales table',
            'sales table'[sales date] >= MIN ( 'products table'[launch date] )
                && 'sales table'[sales date]
                    <= MAXX (
                        FILTER ( ALL ( 'dimdate' ), 'dimdate'[WeekNoOverYears] = TargetWeekNo ),
                        'dimdate'[date]
                    )
        )
    )

 

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 409 members 4,154 guests
Please welcome our newest community members: