cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bmk266 Frequent Visitor
Frequent Visitor

Resampling Four Weeks Data to Sixteen Weeks

I'm currently stuck on this problem.   

  • I have data that shows sales for four week periods; each row is a four week period.   
  • The column "week end" shows the end of this four week period. 
  • I want for each product to show sum of a sixteen week period (so four rows summed up). 
    • This means it will be resampled and it won't be rolling: so four rows get condensed to one. 
    • I'm struggling writing the measure that will allow me to do this; any help will be greatly appreciated

 

what I have
week_endproductsalessales_yag
2018-05-27product a2119
2018-06-24product a2211
2018-07-22product a3123
2018-08-19product a3325
2018-09-16product a5350
2018-10-14product a2112
2018-11-11product a3226
2018-12-09product a3019
2018-05-27product b2524
2018-06-24product b2712
2018-07-22product b3328
2018-08-19product b3826
2018-09-16product b5855
2018-10-14product b2616
2018-11-11product b3328
2018-12-09product b3222

 

and here is what i want:

 

what I want
week_endproductsalessales_yag
2018-08-19product a10778
2018-12-09product a136107
2018-08-19product b12390
2018-12-09product b149121

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
V-pazhen-msft Established Member
Established Member

Re: Resampling Four Weeks Data to Sixteen Weeks

Hi, @bmk266 

 

You could create a new “Period “ column and assign “week_end” column to “Period” column. Then simply drag the sum sales and sales_yag into the visual will do your favorite.

 

Column:
PeriodEnd = SWITCH(TRUE(),

Table[week_end]<=DATE(2018,8,19), DATE(2018,8,19),

Table[week_end]>=DATE(2018,8,19), DATE(2018,12,09))

Period column.JPG
Measure:
sumsales =
SUM(Sheet1[sales])

sumsales_yag = SUM(Sheet1[sales_yag])

result period end.JPG

 


Paul
Best

View solution in original post

1 REPLY 1
V-pazhen-msft Established Member
Established Member

Re: Resampling Four Weeks Data to Sixteen Weeks

Hi, @bmk266 

 

You could create a new “Period “ column and assign “week_end” column to “Period” column. Then simply drag the sum sales and sales_yag into the visual will do your favorite.

 

Column:
PeriodEnd = SWITCH(TRUE(),

Table[week_end]<=DATE(2018,8,19), DATE(2018,8,19),

Table[week_end]>=DATE(2018,8,19), DATE(2018,12,09))

Period column.JPG
Measure:
sumsales =
SUM(Sheet1[sales])

sumsales_yag = SUM(Sheet1[sales_yag])

result period end.JPG

 


Paul
Best

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)