Forum Discussion
Average Days between Orders
- 9 years ago
Hi cplesner,
You an also create calculated columns to calculate DateDiff values based for specific customer, or both customer and product. See:
Previous-Customer = CALCULATE(MAX(Table1[Date]), (FILTER(Table1, EARLIER(Table1[Customer])=Table1[Customer] && EARLIER(Table1[Date])>Table1[Date])))
DateDiff-C = DATEDIFF('Table1'[Previous-Customer],'Table1'[Date],DAY)
Previous-PC = CALCULATE(MAX(Table1[Date]), (FILTER(Table1, EARLIER(Table1[Customer])=Table1[Customer] && EARLIER(Table1[Product])=Table1[Product] && EARLIER(Table1[Date])>Table1[Date])))
DateDiff-PC = DATEDIFF('Table1'[Previous-PC],'Table1'[Date],DAY)
Best Regards,
Qiuyun Yu
Hi cplesner,
You an also create calculated columns to calculate DateDiff values based for specific customer, or both customer and product. See:
Previous-Customer = CALCULATE(MAX(Table1[Date]), (FILTER(Table1, EARLIER(Table1[Customer])=Table1[Customer] && EARLIER(Table1[Date])>Table1[Date])))
DateDiff-C = DATEDIFF('Table1'[Previous-Customer],'Table1'[Date],DAY)
Previous-PC = CALCULATE(MAX(Table1[Date]), (FILTER(Table1, EARLIER(Table1[Customer])=Table1[Customer] && EARLIER(Table1[Product])=Table1[Product] && EARLIER(Table1[Date])>Table1[Date])))
DateDiff-PC = DATEDIFF('Table1'[Previous-PC],'Table1'[Date],DAY)
Best Regards,
Qiuyun Yu
Worked perfectly! thanks