Count Weeks Based on Set Criteria

ag007

New Member
Joined
Apr 8, 2015
Messages
36
Hi all,


I have the following scenario with which I need help in Power Query: multiple Customers with multiple Products and multiple Promotions. Each Product is being sold to a Customer on Promotion.


The period when this happens is represented in the 3rd column. (WeekNum function that represents the calendar week).


What I need is to be able to identify the 1st, 2nd, 3rd (and so on) week for each combination of Customer - Product. Rule: If a promotion for a Customer-Product stops for 3 or more weeks, then when it resumes we re-start counting from 1.


I forgot to mention that the Year should also be considered. (basically I have another column in my original data with the year)
For example if we are in 2016 week 52 and that is week promo 10, then 2017 week 1 will be week promo 11.


Please let me mention that I'm seeking a solution using Power Query.

 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,216,026
Messages
6,128,363
Members
449,444
Latest member
abitrandom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top