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
Anonymous
Not applicable

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
V-pazhen-msft
Community Support
Community Support

Hi, @Anonymous 

 

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
Community Support
Community Support

Hi, @Anonymous 

 

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

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.