Hi experts,
My data is as follow:
Each ID is an unique product.
Products was sent and its sending time is in column "Sending week", its receiving time is in column "Receiving week". Time is count by week number in a year.
if column "Receiving week" is blank, it means " haven't received yet".
ID | Sending week | Receiving week |
100 | week 1 | |
182 | week 1 | week 47 |
183 | week 1 | week 47 |
199 | week 1 | |
200 | week 1 | |
184 | week 1 | week 45 |
185 | week 2 | week 46 |
186 | week 2 | week 45 |
187 | week 3 | week 47 |
188 | week 3 | week 45 |
189 | week 3 | week 45 |
190 | week 3 | week 46 |
191 | week 3 | week 46 |
192 | week 3 | week 47 |
I want to create a column/measure in order to calculate grouped percentages of received products compared with the total number sent products. For example:
- total send of week 1 = count of all week 1 in column A = counta(week 1) = 5
- % receive up to week number 45 of send in week number 1 = count of column D (week 45)/count of column A(week1) = 1/5 = 20%
- % receive up to week number 47 of send in week number 1 = count of column D (week 47) + (week 45)/count of column A(week1) = (2 + 1)/5 = 60%
Desired output:
Explanation | ||||||||||
sending week | receiving week | count of receiving week | Percentage | count of receiving week (per sending week) | receiving percentage | |||||
week 1 | week 45 | 1 | 20% | 1(= week 45 appears once from "sending week" week 1) | 20% because = count of "week 45"/count of sending week " week 1"= 1/5 | |||||
week 1 | week 47 | 2 | 60% | 2 (=week 47 appears 2 times from "sending week" week 1) | 60% because = count of "week 45" + count of "week 46" + count of "week 47" = (1+0 +2)/5 | |||||
week 2 | week 45 | 1 | 50% | 1 | 50% because =count of "week 45"/count of sending week"week 2"= 1/2 | |||||
week 2 | week 46 | 1 | 100% | 1 | 100% because =count of "week 45" + count of "week 46"/count of sending week"week 2"= (1+ 1)/2 | |||||
week 3 | week 45 | 2 | 33% | 2 | 33% because =1/3 | |||||
week 3 | week 46 | 2 | 66% | 2 | 66% because = (1+1)/3 | |||||
week 3 | week 47 | 2 | 100% | 2 | 100% because = (1+1+1)/3 |
The problem is that once I filter a "receiving week", column "sending week" accordingly is filtered, which lead to the percentage of receiving week/sending week is always 100%- incorrect.
I would like to consult you and hopefully this issue can be solved.
Many thanks and regards,
Cindy