如何统计至少观看一次产品视频的客户数量及占比?
统计观看过保护计划视频的客户占比
我需要分析应用内用户的页面点击流程(客户可回退操作,每个操作带时间戳),核心需求是计算至少观看过一次保护计划视频的客户占比——即看过视频的唯一客户数,除以至少访问过保护计划主页面的唯一客户数。当前需要解决的是如何统计至少观看过一次视频的ConsumerID。
字段说明
ActivityType:页面标题(同一页面可重复访问),重点关注两类:- "Products Presented":保护计划主页面
- "Product Video Viewed":观看保护计划视频
ConsumerID:客户唯一标识EventDateTime:每次页面访问的时间戳
原尝试的DAX公式(存在语法错误)
DistinctCustomersPlayedVideo = CALCULATE( DISTINCTCOUNT(ConsumerFunnelTime[ConsumerID], COUNT(ConsumerFunnelTime[ActivityType] IN {"ProductVideoViewed"} >= 1)) )
数据示例
| EventDateTime | ActivityType | ConsumerID | ConsumerFunnel |
|---|---|---|---|
| 22:48.0 | Products Presented | 4623439 | 1 |
| 22:50.0 | Products Presented | 4623439 | 2 |
| 26:15.0 | Product Video Viewed | 4623439 | 3 |
| 44:27.0 | Products Presented | 4673980 | 1 |
| 44:27.0 | Products Presented | 4673980 | 1 |
| 29:10.0 | Products Presented | 4674538 | 1 |
| 29:11.0 | Products Presented | 4674538 | 2 |
| 11:50.0 | Products Presented | 4674699 | 1 |
| 11:50.0 | Products Presented | 4674699 | 1 |
| 21:02.0 | Products Presented | 4674721 | 1 |
| 21:03.0 | Products Presented | 4674721 | 2 |
| 52:17.0 | Products Presented | 4674837 | 1 |
| 52:19.0 | Products Presented | 4674837 | 2 |
| 26:16.0 | Products Presented | 4674837 | 3 |
| 26:18.0 | Products Presented | 4674837 | 4 |
正确的DAX解决方案
1. 统计至少观看过一次视频的唯一客户数
DistinctCustomersPlayedVideo = CALCULATE( DISTINCTCOUNT(ConsumerFunnelTime[ConsumerID]), ConsumerFunnelTime[ActivityType] = "Product Video Viewed" )
说明:直接筛选出所有观看视频的记录,再统计其中的唯一ConsumerID,自动去重保证每个客户只被计数一次。
2. 统计至少到达过保护计划主页面的唯一客户数
DistinctCustomersReachedProtectionPage = CALCULATE( DISTINCTCOUNT(ConsumerFunnelTime[ConsumerID]), ConsumerFunnelTime[ActivityType] = "Products Presented" )
3. 计算占比
VideoViewedRate = DIVIDE( [DistinctCustomersPlayedVideo], [DistinctCustomersReachedProtectionPage], 0 // 处理分母为0的情况,返回0 )
说明:使用DIVIDE函数避免除零错误,结果为0-1的小数,可设置格式为百分比显示。
内容的提问来源于stack exchange,提问作者talkingtoducks
相关产品推荐
相关产品推荐

