Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

how many customer keep trading next 3 month after create accounts date.

Dear All,

 

I would like to analyze how many customer keep trading next 3 month after create accounts.

I try to create some measure but i can't input into Chart

 

Table 1 _  Date

 

Table 2 _ Customer

Customer IDAccount NumberCreate Date
AAA101-01-2018
AAA202-01-2018
AAA303-01-2018
BBB404-02-2018
BBB505-02-2018
BBB606-02-2018
CCC707-03-2018
DDD807-03-2018
EEE909-04-2018
EEE1010-04-2018


Table 3 _ Transaction

Account NumberBill NumberTotal TransactionTransaction DateTransaction YYYYMM
112330001-01-2018201801
112430001-02-2018201802
212530001-02-2018201802
212630001-02-2018201802
412730007-02-2018201802
512830007-03-2018201803
612930007-04-2018201804
713030007-03-2018201803
113130001-04-2018201804
113230001-05-2018201805

 

 

Result expect

 

Customer ID1st create account  month Trading in next 3 month countNote
AAA2018-Jan2Trade in Jan,Feb, Apr, May
BBB2018-Feb3Trade in Feb,Mar,Apr
CCC2018-Mar1Trade in Mar
DDD2018-Mar0No Trade
EEE2018-Apr0No Trade

 

 

1st create account  month  = CALCULATE(
MIN(Customer[Create Date]),
FILTER(Customer,Customer[AAA]=EARLIER(Customer[AAA]))
)

 

 

Trading in next 3 month count = CALCULATE (
DISTINCTCOUNT(Transaction Date[Transaction YYYYMM]),
DATESINPERIOD ( DimDate[Date],MIN(DimDate[Date]),3, MONTH )
)

 

 

When i move "Trading in next 3 month count" into legend - chart , it don't allow me .

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

As we know we cannot add the measure to the legend. So we can create a calculated table to work around, and create visual using the table.

 

Table = 
SUMMARIZECOLUMNS (
    Customer[Customer ID],
    "1st create account  month", 'Customer'[1st create account  month],
    "Trading in next 3 month coun", [Trading in next 3 month count],
    "Note", IF (
        ISBLANK ( 'Customer'[Trading in next 3 month count] ),
        BLANK (),
        "Trade in "
            & CONCATENATEX ( DISTINCT ( 'Transaction'[Month] ), 'Transaction'[Month] )
    )
)

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

As we know we cannot add the measure to the legend. So we can create a calculated table to work around, and create visual using the table.

 

Table = 
SUMMARIZECOLUMNS (
    Customer[Customer ID],
    "1st create account  month", 'Customer'[1st create account  month],
    "Trading in next 3 month coun", [Trading in next 3 month count],
    "Note", IF (
        ISBLANK ( 'Customer'[Trading in next 3 month count] ),
        BLANK (),
        "Trade in "
            & CONCATENATEX ( DISTINCT ( 'Transaction'[Month] ), 'Transaction'[Month] )
    )
)

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thank for your support, your solution is working with my situation

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.