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

Count Customers shopped different time periods

Hi,

 

I'm looking to get a count of customers who have shopped in the last 13 months, and also shopped in the prior 13 months.

 

I have a fact table [orders], date table [dates] and customer table [customers].

 

Order table is linked to customer table by column [email] which is to be used for the count. Order table is also linked to dates table through [FiscalDay] column.

 

I can get the count of the last 13 months to work, but can't see a count of customers who shopped in BOTH periods.

 

Thanks

 

Mike

 

 

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

Hi @Anonymous,

 

>>I can get the count of the last 13 months to work, but can't see a count of customers who shopped in BOTH periods.

Maybe you can try to following my logic:

1. Create variable to store customer list shopped in last 13 months.
2. Create variable to store customer list who shopped between last 26 months and last 13 months.
3. Use INTERSECT function to get customers who both shopped in two periods.
4. Count above intersect list.

 

If you have confused on coding formula, please share some sample data to help us clarify your table structure and test to coding formula.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

>>I can get the count of the last 13 months to work, but can't see a count of customers who shopped in BOTH periods.

Maybe you can try to following my logic:

1. Create variable to store customer list shopped in last 13 months.
2. Create variable to store customer list who shopped between last 26 months and last 13 months.
3. Use INTERSECT function to get customers who both shopped in two periods.
4. Count above intersect list.

 

If you have confused on coding formula, please share some sample data to help us clarify your table structure and test to coding formula.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.