[{"id":"bcb0874d-299b-448e-9552-9e9b25ef80dd","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8ce3627e-9e58-471b-9133-4f135d191e7b","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"ae60ae59-34f5-4f32-a8eb-243ed1457543","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3d4848c3-910f-4ffa-9153-60bb507334a9","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"133f4ca6-d951-4d65-a618-3dc6301266f7","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de62ec1c-813e-40b1-8160-a4cd109afe64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2426c71d-8332-4cbd-a436-1ec4f8666464","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2ce7b6b0-78aa-4e4b-bf8a-e4ba2f988298","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4706db46-0811-4652-8f59-1e0a1da84758","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8f1271bb-2cd9-4f39-9897-c15b239ee7ab","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"677e13a7-6f3e-449f-986c-2c3a26f8d54f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"5e40f6dc-caec-49d7-a1d0-be65f06815ba","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2457f0e0-9e71-4860-a87d-065e0fb84f84","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5c67fd0-1145-482c-9113-97b492c44c18","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"a609a8fa-ab91-4c1d-a1c3-d209d0463303","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b4a9eb15-94e5-48df-b218-a24138f0cf9c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

关联性分析

需求描述

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

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

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

image2021-12-17_16-48-46.png

在仪表板中实现

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

image2021-12-17_16-53-41.png

DISTINCTCOUNT('CorrelationAnalysis'[CustomerID])

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

image

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

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

image2021-12-17_17-0-8.png

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 产品的相关性非常大,大多数用户可能会同时需要两款产品。那么在做产品销售时,就可以有所侧重。

image2021-12-17_17-16-33.png