转至元数据结尾
转至元数据起始

1.需求描述



在大多数销售数据分析中,用户希望进行关联性分析,例如同时购买A产品和B产品的数据分析,包括销售额、销售数量、销售百分比。

下图中第二列分析了购买Forguncy 的同时购买了当前行产品的用户数,第三列进一步分析了这种用户占Forguncy 所有用户数的百分比。

类似这种分析可以快速查看到产品的相关性。



2. 在仪表板中实现



添加度量值获取用户数量,将来绑定到组件中会根据纬度进行统计。

DISTINCTCOUNT('CorrelationAnalysis'[CustomerID])


接下来获取购买了特定产品(Forguncy)的用户数量。

CALCULATE(
		distinctcountx(
                SELECTATTRIBUTES(
                    'CorrelationAnalysis',
                    'CorrelationAnalysis'[CustomerID]				
                    ),
                'CorrelationAnalysis'[CustomerID]		
                ),			
				Filter(SUMMARIZECOLUMNS(
					'CorrelationAnalysis'[CustomerID],
					"CustomerPurchaseProductCount",
					CALCULATE(
						DISTINCTCOUNTX(							
                                'CorrelationAnalysis',                                
							    'CorrelationAnalysis'[ProductName]
						        ),
                                IN('CorrelationAnalysis'[ProductName],"Forguncy")
					)					
				),[CustomerPurchaseProductCount] >=1)
		)
		
	


进一步求这种购买两种产品的用户占Forguncy 所有用户数的百分比。

DIVIDE(
  'CorrelationAnalysis'[Customer Count for purchase Forguncy],
  Calculate(
    'CorrelationAnalysis'[Customer Count for purchase Forguncy],
    Removefilters(
     			 'CorrelationAnalysis'[ProductName]
    			)
  		)
)


接下来就可以将纬度,以及各个度量值绑定到透视中展示了。

可以看到购买了Forguncy 的用户,同时购买SpreadJS 的有2个用户,这2个用户占所有Forguncy 用户的40%。

而购买了Forguncy 的用户,同时购买Wyn的有4个用户,这4个用户占所有Forguncy 用户的80%。这说明Forguncy 与Wyn 产品的相关性非常大,大多数用户可能会同时需要两款蟾片。那么在做产品销售时,就可以有所侧重。





  • 无标签