简体   繁体   English

如何使用 DAX 在 Power Bi 上定义新客户和现有客户?

[英]How to define new and existing customers on Power Bi using DAX?

I would like to define 2 sets of customers to identify number of product opens per year and the type of customer they are:我想定义 2 组客户来确定每年打开的产品数量和他们的客户类型:

Existing Customer Adds Product - these are customers who had an existing account with us previously (previous year) but then decided to open up a new product with us现有客户添加产品 - 这些客户之前(去年)在我们这里有一个现有帐户,但后来决定与我们一起开发新产品

New Customer - this is customers who have only opened an account this year with us but also opened a new product too新客户 - 这是今年只在我们这里开设账户但也开设了新产品的客户

I have an account level table example:我有一个帐户级别表示例:

Account Code    Account Open Date
12345           04/02/18
12389           09/09/20
43244           23/10/19

I also have a product level table example:我还有一个产品级别表示例:

Account Code    Product Code    Product Type    Product Open Date
12345           12345RED        Red             09/02/18
12389           12389RED        Red             09/11/20
43244           43244BLACK      Black           03/03/20

Based on the year and also the account date opened and the product open date i would like to define if the customer is a new or existing customer in a new column.根据年份以及开户日期和产品开户日期,我想在新列中定义客户是新客户还是现有客户。

Example: If Customer A opened an account in 03/03/2019 and this customer opened a new product in 20/10/2020 this customer will be an existing customer who has a product.示例:如果客户 A 在 2019 年 3 月 3 日开设了账户,而该客户在 2020 年 10 月 20 日开设了新产品,则该客户将是拥有产品的现有客户。

if Customer B opened an account in 03/06/20 and this customer opened a new product within 60 days (05/07/20) this customer is a new customer如果客户 B 在 03/06/20 开户并且该客户在 60 天 (05/07/20) 内开设了新产品,则该客户是新客户

if customer c opened an account in 03/05/20 and this customer opens a new product after 60 days (09/12/20) this customer is an existing customer adds product如果客户 c 在 03/05/20 开户并且该客户在 60 天 (09/12/20) 后开设了新产品,则该客户是现有客户 添加产品

please could you help me on this.请你能帮我解决这个问题吗?

thank谢谢

As a general Business Intelligence applied to Power BI, to slice-and-dice your facts based on whether the Customer was Existing or New on the Event date , you need to defined an attribute on the Fact table itself .作为应用于 Power BI 的一般商业智能,要根据客户在事件日期是现有还是新来切分事实,您需要在事实表本身上定义一个属性

Going one step further, the practical implementation consists of:更进一步,实际实施包括:

  1. define a new dimension: Customer Type with an attribute Type : {Existing, New}.定义一个新维度:具有属性Type Customer Type Type :{Existing, New}。
  2. in the back-end , add the Foreign Key of this new dimension Customer Type to your Fact在后端,将此新维度Customer Type的外键添加到您的 Fact
  3. in the Front-end use Customer Type dimension to slice-and-dice over your facts based on whether the customer is Existing or New在前端使用客户类型维度根据客户是现有客户还是新客户对您的事实进行切片和切块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM