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.
v-jianboli-msft
3 years agoCommunity Support
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.
abc_777
3 years agoSolution Specialist
perfect man,
thats the thing i wanted. really great.
thanks for your help