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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ADSL
Post Prodigy
Post Prodigy

Calculation New, Repeat Customer

Hi BI Community Team,

 

I have a sales order table (Aug'23 till Oct'23), with this I have created a measure below to find the customer purchased:

 

Customer Purchased = CALCULATE(DISTINCTCOUNT('Sales Order'[Customer Code]), 'Sales Order'[InvoiceType] = "F2", 'Sales Order'[OrderType] = "SALE")
 
So now we're looking for New Customer & Repeat Customer that calculation are current month compare to previous month.
 
Example: we're standing in Oct'23, then compare with Sep'23. If customer can see/find in Oct'23 => Repeat. If customer cannot find then it's New. Actually, customer purchased = Repeat + New
 
 
Any suggestion/advise to find it?
 
Thanks and Regards,
20 REPLIES 20
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1700958385844.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

Thank you for your helpful feedback.

 

In sales order table, it have for both customer order and return then when we calculate and find the customer purchased, we need to count and filter only for 02 column name 'Sales Order'[InvoiceType] = "F2"'Sales Order'[OrderType] = "SALE").

 

If we don't filter these columns then number of customer purchased are more than because it count for customer return too.

 

So any suggestion/advice of your meause?

 

Thanks and Regards,

 

Hi,

Revise my measures to:

New customers = CALCULATE([Customer Purchased],FILTER(VALUES('Sales Order'[Customer Code]),[Date of first interaction]>=MIN('Calendar'[Date])))
Repeat customers = CALCULATE([Customer Purchased],FILTER(VALUES('Sales Order'[Customer Code]),[Date of first interaction]<MIN('Calendar'[Date])))

I do not see any change in the answer though.

Ashish_Mathur_0-1701042512504.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

After revised and follow your new measure, then I am mapping with manual calculation. It's different.

 

Screenshot below, I am doing in manual by mapping between sales order in Sep'23 and Oct'23.

 

> Customer purchased => customer have order

> Repeat => custoemr have order in current month and last month.

> New => customer have order in current month and never have any order in last month

> These calculation are required to excluded == Sales Order'[InvoiceType] = "F2", 'Sales Order'[OrderType] = "SALE")

 

Please kindly help!

 

2023-11-27_20-50-04.jpg

2023-11-27_20-36-34.jpg

 

Sample link - https://drive.google.com/drive/folders/1UzgG-CXW3G0diCSfILUYRqXq9piZWZLj?usp=sharing 

Thanks and Regards,

My formula is correct.  Please check the data thoroughly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

When I copy the list of customer code order in Oct'23 and match the customer code order in Sep'23, if found is "Repeat" and Not found is "New" then see the result below.

 

Is it possible that still count from these column Sales Order'[InvoiceType] = "F2", 'Sales Order'[OrderType] = "SALE"? 

 

2023-11-28_11-14-20.jpg

 

Any suggestion/advise?

Hi,

Prepare a simple Table visual as seen in the screenshot below.  See which Customer codes are not being identifies correctly.  DIY.

Ashish_Mathur_0-1701156862706.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

I have followed your advise then found the result after choose a few customer to mapping with manual.

 

1. New --- customer code: CT01718 have one transcation in Oct'23 but your calculation is showing in "Repeat". It should be in "New"

 

2. Repeat --- customer code: CT03498 have 02 transcation in Oct'23, your calculation is showing "Repeat", it should be in "New" because transcation are in the same month.

 

=> Even customer have one order or many in the same month, we still call "New" if they didn't have order in the last month.

=> For customer  have order in the last month, and current month are also have then called " Repeat".

=> column that we count are InvoiceType "F2" and OrderType "SALE". these column are refer to order and sales, beside it's return.

 

2023-12-02_15-59-10.jpg

Sample file https://drive.google.com/drive/folders/1UzgG-CXW3G0diCSfILUYRqXq9piZWZLj?usp=sharing 

Any suggestion?

 

 

 

Hi,

CT01718 has transactions in Aug and Sep as well.

Ashish_Mathur_0-1701560263080.png

The same if true for CT03498 as well.

Please recheck.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

Yes, however we're comparing current and last month to find how many new and repeat of customer in the current that we stand.

 

So all questions that raised in Oct and compare to Sep. If we're standing in Sep then compare to Aug.

 

Please kindly check and advise.

 

Thanks and Regards,

In the month filter drop down, select only one month - October.  Both those codes have transactions in September and therefore for the month of October, they should both be classified as Repeat.

Ashish_Mathur_0-1701561542749.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

One customer have multiple sales team serviced (sell different brand/category), if you check this customer code: CT01718 will see transcation from Aug till Oct. But we filter by sales team = Food1, Brand = Kingfisher then have transcation in Aug & Oct. 

 

So if we're standing in Oct, then this customer is New because no transcation in Sep.

 

2023-12-03_07-13-41.jpg

 

Please check and advise.

Hi,

Please check now.  File attached.

Ashish_Mathur_0-1701563368315.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

I have checked your file, the number is more than I count manually in excel.

 

This result is distinct count in excel file.

 

2023-12-03_08-57-41.jpg

Please check and advise.

How do you expect me to help you with just that statement.  DIY.  Solve it by yourself now.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

Just feedback what I see however still need your support and advise. sometimes we misunderstand or wrong explain then result also are different.

 

Thanks and Regards,

I really do not know how ealse to help you.  Create a small dataset and try my formulas on that small dataset.  See if you get the perfect result there or not.  If there is a problem even on that small dataset, then we will revise the formula.  Finally we will then plug in your large dataset.  Please send time on doing this checking yourself.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Well noted. Thank you very much for your value time and help.

 

Best Regards,

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1700958385844.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.