Forum Discussion
abc_777
3 years agoSolution Specialist
hi
Hello,
I want to add Days since Last purchased (189 + 155 + 139) = 483 then divide it with Invoice Distinctcount (Summary) 3
as i have 3 indivisual invoice date. so 483/3 = 161 is his ave...
- 3 years ago
Hi abc_777 ,
Based on your description, I have created a simple sample:
Please try:
Days Since last Purchase = SUMX(SUMMARIZE('bm_retail_t sale','bm_retail_t sale'[INVOICE_DT]),DATEDIFF( TODAY(),'1 Measure Table- Retail'[Day of Last Purchase],DAY))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 3 years ago
Hi abc_777 ,
Please try:
Days Since last Purchase = SUMX(SUMMARIZE('bm_retail_t sale','bm_retail_t sale'[Customer],'bm_retail_t sale'[INVOICE_DT]),DATEDIFF(MAXX(FILTER(ALL('bm_retail_t sale'),[Customer]=EARLIER('bm_retail_t sale'[Customer])&&[INVOICE_DT]<EARLIER('bm_retail_t sale'[INVOICE_DT])),[INVOICE_DT]),'1 Measure Table- Retail'[Day of Last Purchase],DAY))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
abc_777
3 years agoSolution Specialist
hi
here is the measure
Days Since last Purchase = DATEDIFF( TODAY(),'1. Measure Table- Retail'[Day of Last Purchase],DAY)
and
Day of Last Purchase = LASTDATE('bm_retail_t sale'[INVOICE_DT])
i want to make average of Days Since last Purchase. please chorrect the measure for average
Average Days Since Last Purchase = DIVIDE([Days Since last Purchase], [Invoice DISTINCTCOUNT (Summary)], 0)
thanks