Forum Discussion
Allocating Weekly YouTube View Counts to Corresponding Months
Hi Experts,
I am encountering an issue with accurately calculating monthly YouTube views from data that is captured on a financial week basis. Our dataset does not include daily views; instead, views are aggregated weekly, which complicates month-end reporting when weeks span two different months.
Below is a snippet of the dataset for reference:
| Financial Week | WeekStartDate | WeekEndDate | YoutubeVideo | ViewCount |
| Week 01 | 1-Apr-24 | 7-Apr-24 | Madagascar | 6 |
| Week 02 | 8-Apr-24 | 14-Apr-24 | Madagascar | 56 |
| Week 03 | 15-Apr-24 | 21-Apr-24 | Madagascar | 2 |
| Week 04 | 22-Apr-24 | 28-Apr-24 | Madagascar | 37 |
| Week 05 | 29-Apr-24 | 5-May-24 | Madagascar | 21 |
| Week 06 | 6-May-24 | 12-May-24 | Madagascar | 92 |
| Week 07 | 13-May-24 | 19-May-24 | Madagascar | 1 |
| Week 08 | 20-May-24 | 26-May-24 | Madagascar | 3 |
| Week 09 | 27-May-24 | 2-Jun-24 | Madagascar | 6 |
| Week 10 | 3-Jun-24 | 9-Jun-24 | Madagascar | 23 |
| Week 01 | 1-Apr-24 | 7-Apr-24 | Paw Patrol | 15 |
| Week 02 | 8-Apr-24 | 14-Apr-24 | Paw Patrol | 8 |
| Week 03 | 15-Apr-24 | 21-Apr-24 | Paw Patrol | 31 |
| Week 04 | 22-Apr-24 | 28-Apr-24 | Paw Patrol | 5 |
| Week 05 | 29-Apr-24 | 5-May-24 | Paw Patrol | 5 |
| Week 06 | 6-May-24 | 12-May-24 | Paw Patrol | 3 |
| Week 07 | 13-May-24 | 19-May-24 | Paw Patrol | 16 |
| Week 08 | 20-May-24 | 26-May-24 | Paw Patrol | 13 |
| Week 09 | 27-May-24 | 2-Jun-24 | Paw Patrol | 34 |
| Week 10 | 3-Jun-24 | 9-Jun-24 | Paw Patrol | 10 |
The challenge arises when financial weeks like Week 05 (29-Apr-24 to 5-May-24) and Week 09 (27-May-24 to 2-Jun-24) overlap between two months. Currently, our methodology does not split the view counts proportionally by the number of days in each month, leading to inaccuracies in monthly reporting.
Requirement: I need a method to correctly allocate view counts based on the number of days a financial week falls into each month. For example, for Week 05 from 29-Apr-24 to 5-May-24 with a view count of 21 for Madagascar:
- April should account for 2 days (29-Apr and 30-Apr). Therefore, the views for April would be calculated as follows: (2 days / 7 total days) * 21 views = 6 views.
- May should account for 5 days (1-May to 5-May). Therefore, the views for May would be calculated as follows: (5 days / 7 total days) * 21 views = 15 views.
So the expected numbers are below:
| Financial Month | YoutubeVideo | Sum of ViewCount |
| Apr-24 | Madagascar | 107 |
| Apr-24 | Paw Patrol | 60 |
| May-24 | Madagascar | 113 |
| May-24 | Paw Patrol | 45 |
| Jun-24 | Madagascar | 27 |
| Jun-24 | Paw Patrol | 34 |
| Total | 386 |
I have attached a PBIX for your reference.
WeeklyViews.pbix
Anyone, Please help!!
Thank you,
Please check the math, I am arriving at different numbers.