对于给定的年份和月份选择,报告应显示分类为3个存储桶的客户列表...
客户流失-曾在上一年中选择日期范围但在当年没有销售的客户
新客户-具有销售年份的客户选择日期范围,但没有上一年的客户
跨站交易-选择日期范围的前一年和当年销售的客户
该报告还应显示属于每个谨慎存储段的所有唯一客户的摘要计数...
样品...
摘要:对于每个存储桶,我应该看到在选定日期范围内属于每个存储桶的客户数量
搅动新跨界车
Image of working Details in PowerBI using the creates variables described above:
为此,我创建了一个累计的当年和上一年度的总计,并根据选定的日期范围进行调整
Cumulative_CY =
SUMX(
VALUES(CustomerDta[BillToCustomerID]),
CALCULATE( SUM(CustomerDta[CY]),
FILTER(
ALLSELECTED(CustomerDta),
CustomerDta[Date]<= MAX(CustomerDta[Date]))))
Cumulative_PY =
SUMX(
VALUES(CustomerDta[BillToCustomerID]),
CALCULATE( SUM(CustomerDta[PY]),
FILTER(
ALLSELECTED(CustomerDta),
CustomerDta[Date]<= MAX(CustomerDta[Date]))))
然后我为需要跟踪的每个存储区创建了一个变量...
Churn = IF(AND([Cumm_PY] >0,[Cumm_CY]<=0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)
New = IF(AND([Cumm_PY] <=0,[Cumm_CY]>0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)
CrossOver = IF(AND([Cumm_PY] > 0,[Cumm_CY]>0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)
使用我上面描述的内容,我能够创建报告的详细信息,如下图所示,但无法获取表格对象底部3个存储桶的摘要计数或单独的单个变量视觉效果。删除客户ID后,所有内容都会被归类为交叉...
我需要能够对一个条件变量求和,该条件变量的值基于前一年的销售额确定为1或0,根据日期范围选择确定为本年度...
创建它们后,我尝试对它们求和...但这不是提供的选项
Churn = IF(AND([Cumm_PY] >0,[Cumm_CY]<=0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)
New = IF(AND([Cumm_PY] <=0,[Cumm_CY]>0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)
CrossOver = IF(AND([Cumm_PY] > 0,[Cumm_CY]>0),DISTINCTCOUNT(CustomerDta[BillToCustomerID]),0)