Forum Discussion

puru85's avatar
puru85
Icon for Helper II rankHelper II
1 year ago
Solved

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 WeekWeekStartDateWeekEndDateYoutubeVideoViewCount
Week 011-Apr-247-Apr-24Madagascar6
Week 028-Apr-2414-Apr-24Madagascar56
Week 0315-Apr-2421-Apr-24Madagascar2
Week 0422-Apr-2428-Apr-24Madagascar37
Week 0529-Apr-245-May-24Madagascar21
Week 066-May-2412-May-24Madagascar92
Week 0713-May-2419-May-24Madagascar1
Week 0820-May-2426-May-24Madagascar3
Week 0927-May-242-Jun-24Madagascar6
Week 103-Jun-249-Jun-24Madagascar23
Week 011-Apr-247-Apr-24Paw Patrol15
Week 028-Apr-2414-Apr-24Paw Patrol8
Week 0315-Apr-2421-Apr-24Paw Patrol31
Week 0422-Apr-2428-Apr-24Paw Patrol5
Week 0529-Apr-245-May-24Paw Patrol5
Week 066-May-2412-May-24Paw Patrol3
Week 0713-May-2419-May-24Paw Patrol16
Week 0820-May-2426-May-24Paw Patrol13
Week 0927-May-242-Jun-24Paw Patrol34
Week 103-Jun-249-Jun-24Paw Patrol10

 

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 MonthYoutubeVideoSum of ViewCount
Apr-24Madagascar107
Apr-24Paw Patrol60
May-24Madagascar113
May-24Paw Patrol45
Jun-24Madagascar27
Jun-24Paw Patrol34
Total 386

 

I have attached a PBIX for your reference. 
WeeklyViews.pbix
Anyone, Please help!!

Thank you,


2 Replies