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
nanutum
Helper I
Helper I

How to Create : New/Returning/Lost Customers in 2 Period

Hi Expert 

           i can create New/Returning/Lost Customer in only 1 date table 

but i want to know how to create 2 date table

my data used 2 period 

Ex:

Datatable = Tran

Date table = Period1 and Period2  

 

** Thank @amitchandak  in code below

Period1 Sales = (
VAR _Cuur_start = Min(Period1[Period1])
VAR _Curr_END = Max(Period1[Period1])
return
calculate(sum('Tran'[Amount]),'Tran'[DATE] >= _Cuur_start && 'Tran'[DATE] <= _Curr_END )
)
Period2 Sales = (
VAR _Cuur_start = Min(Period2[Period2])
VAR _Curr_END = Max(Period2[Period2])
return
calculate(sum('Tran'[Amount]),'Tran'[DATE] >= _Cuur_start && 'Tran'[DATE] <= _Curr_END ))

 

How to create 

New/Returning/Lost Customer  base on Period1 and count/sum in Period2

4 REPLIES 4
Icey
Community Support
Community Support

Hi @nanutum ,

 

I don't quite understand what you want. Please share me some sample data and the result you want.

 

 

Best Regards,

Icey

hi @Icey 

Ex:

Sample

Calcucate  Base on DATE Period1 Table and DATE Period2 Table 

     PowerBI Question03.png

Filter Period1 on 2019 06 - 2019 10 

Filter Period2 on 2019 12 - 2020 02

** Period1 and Period2 can Flexible

Icey
Community Support
Community Support

Hi @nanutum ,

 

I'm not sure if my understanding is correct. Please check:

 

Try to create another Date table, and then create relationship with your fact table.

Then, create a Matrix visual based on the Date column of the new Date table and put the measure below in Values field.

Measure =
SWITCH (
    TRUE (),
    [Period1 Sales] = BLANK ()
        && [Period2 Sales] <> BLANK (), "New",
    [Period1 Sales] <> BLANK ()
        && [Period2 Sales] <> BLANK (), "Return",
    [Period1 Sales] <> BLANK ()
        && [Period2 Sales] = BLANK (), "Lost"
)

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @Icey 

Thank you for help me 

     i already done about Period1 Sales and Period2 Sales

 

 

PowerBI Question04.png

 

 

Period1 Sales = (
VAR _Cuur_start = Min(Period1[Period1])
VAR _Curr_END = Max(Period1[Period1])
return
calculate(sum('Tran'[Amount]),'Tran'[DATE] >= _Cuur_start && 'Tran'[DATE] <= _Curr_END )
)

 

 

Period2 Sales = (
VAR _Cuur_start = Min(Period2[Period2])
VAR _Curr_END = Max(Period2[Period2])
return
calculate(sum('Tran'[Amount]),'Tran'[DATE] >= _Cuur_start && 'Tran'[DATE] <= _Curr_END ))

PowerBI Question05.png

 

How to measure create New/Returning/Lost Customers  sum amount

i found create Measure New/Returning/Lost Customers. But only 1 period 

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.