First Purchase Date - DAX

Hi,

Any idea how to do a DAX calculation for the first purchase of customers in FactSales?

Thank you.

Regards,
Dennis

Hi @dennistgc

I think you can try the function Firstdate. Would be easier if there can be a demo pbix file to look into.

Let us know if it works.

Thanks

Najah

Hi @dennistgc,

@NajahS is right exploring in FIRSTDATE try something like this if you want the first customer purchase all time. Should you need further assistance please provide a PBIX. Thanks.

First Customer Purchase = 
CALCULATE( FIRSTDATE( Sales[OrderDate] ), 
    FILTER( ALL( Sales[OrderDate], Sales[Customer Name Index] ), Sales[Customer Name Index] IN VALUES( Customers[Customer Name Index] )),
    ALL( Dates )
)
1 Like

Hi,

It works perfectly. My apologise if I can ask further. If I add in a condition that my first purchase date which must be older than a date, said customer profile created date.

Thank you.

Great.

Sure you can extend the filter condition. Below a video to help you on your way. Should you need further assistance with that scenario, please provide a sample PBIX.

Hi Melissa,

Thanks for your help. Enclosed the PBIX sample for your further assist.

I had 2 tables which is FactLeadMaster and FactSalesInvoice and the relationship was created.

The idea like this:

  1. I had a LeadMaster, which is for the customer turn up analysis. I had a set of customer turn up on May and Fiscal Year 2020, first I need to get the first sales that the customer turn up on May and Fiscal Year 2020. The first sales may be on or after May and Fiscal year 2020 (as long as it is first sales). The first sales MUST greater than firstvisitdate in leadmaster.

  2. At the same time, the first sales in total can be categorised under DimAgedGroup.

Thank you.

Check out the below for how you can do this. Same technique

Sam

Hi @dennistgc, we’ve noticed that no response has been received from you since the 6th of June. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

Hi @dennistgc,

Did the training content provided by Sam help you solve it?
If not, how far did you get?

Hi @dennistgc, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!

Hi Melissa,

Finally, it is solved. Any idea that to extend that my salesman’s customers first purchase?

Thank you.

Sure but that will depend on your model.
Can you share a sample or at least an image of the model view that shows the relationship for salespeople? And would you mind opening a new thread OR removing the solved indicator, thanks.

Hi @dennistgc, just a friendly reminder, that asking more than one question in a forum thread around the same project or piece of development work is considered inappropriate. If you have a follow question or concern related to this topic please start a new topic. More details can be found here - Asking Questions On The Enterprise DNA Support Forum. Thanks!

ok. sure. thanks

ok. noted.