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

Need help with DAX

 Hello Everyone,

 

I need help with the DAX formula. My question is how to calculate the first purchase for each new customers for each particular month which was closed by a sales man as well as accumulated sales closed by sales man.

 

Is there any way to do this?

 

Also I'm not able to find the option of file attachment so that I can provide my working file.

 

Thanks in advance.

 

Warm Regards,

Harsh

1 ACCEPTED SOLUTION
kentyler
Solution Sage
Solution Sage

Assuming you have a Calendar table with your months, and a Salesman table that lists your Salesmen and a Sales table that lists the sales, you should be able to put the month column from the calendar table, the salesman column from the salesman table and the sale amount from the sales table all on a matrix and set the sales amount column to "Sum". That will give you the total sales for the saleman for the month.
The first part of your question is trickier. First you have to define "new customer". Does it mean never had a purchase ? or didn't purchase last year ? there are many ways of defining it. 
The next issue is do you mean "new customer" for a particular sales man... or "new customer" in terms of any sales to that customer by any salesman ?  One way you will have to use CALCULATE to get ALL the sales and then filter for sales that happened before the current date, the other way you will have to add a filter for the salesman, so you can see if the customer ever bought from a particular salesman before.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

1 REPLY 1
kentyler
Solution Sage
Solution Sage

Assuming you have a Calendar table with your months, and a Salesman table that lists your Salesmen and a Sales table that lists the sales, you should be able to put the month column from the calendar table, the salesman column from the salesman table and the sale amount from the sales table all on a matrix and set the sales amount column to "Sum". That will give you the total sales for the saleman for the month.
The first part of your question is trickier. First you have to define "new customer". Does it mean never had a purchase ? or didn't purchase last year ? there are many ways of defining it. 
The next issue is do you mean "new customer" for a particular sales man... or "new customer" in terms of any sales to that customer by any salesman ?  One way you will have to use CALCULATE to get ALL the sales and then filter for sales that happened before the current date, the other way you will have to add a filter for the salesman, so you can see if the customer ever bought from a particular salesman before.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


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.

Top Solution Authors