Forum Discussion
Anonymous
6 years agoNot applicable
DateDiff showing wrong value
Hello - Using the calculated column below, my datediff number if not giving me the correct values. The order below shipped on June 17. The lead for that eventually generated an order was ...
- 6 years ago
Not knowing what the relationship is between your two tables, you could try this expression
Date Diff = VAR __orderdate = MIN ( SalesLifecycle[LeadCreateDate] ) VAR __thisorder = MIN ( SalesLifecycle[Order] ) VAR __shippeddate = CALCULATE ( MIN ( Shipments[Date Shipped] ), ALLSELECTED ( Shipments ), Shipments[Order] = __thisorder ) RETURN DATEDIFF ( __orderdate, __shippeddate, DAY )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
v-eachen-msft
Community Support
6 years agoHi Anonymous ,
You could create two new measures to show "FIRSTDATE(SalesLifecycle[LeadCreateDate])" and "LASTDATE(Shipments[Date Shipped])". Then check if it returns the right date and use MAX/MIN to get correct date.