Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Solved! Go to Solution.
@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 ) )
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] ) ) )
@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 ) )
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] ) ) )
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
67 | |
60 | |
51 | |
36 | |
36 |
User | Count |
---|---|
83 | |
72 | |
58 | |
45 | |
44 |