Forum Discussion
Userelationship
- 6 years ago
Anonymous , Both date are from the same table. So you do not need userelation for date diff.
In a new column = datediff(order[due Date], order[Shipped Date],DAY)
In a new measure= datediff(min(order[due Date]), Max(order[Shipped Date]),DAY) // Refer my blog for row context
Now use relation is which date you want to use when you display this. So on top of this formula, you can use one of the date.
Or can have two formula one for each date.
Anonymous ,Can you share sample data and sample output in table format?
I think what I am asking is fairly straightforward.
Trying to use a DATEDIFF formula to acheive the days difference between two date fields that are on the same table. One field is active between the date table, the other is inactive. Due Date is active. Date Shipped is inactive.
When I try to write the measure, the Orders(Due Date) field does not appear in the formula bar so I cannot select it.
- Anonymous6 years agoNot applicable
amitchandak Essentially, here is the measure that I am trying to write. I realize this is not at all correct, but I need be able to subtract these dates from each other. And the Orders (Due Date) does not show up in my formula bar unless I put something like Userelationship in front of it (even thought it is the active relationship).
- amitchandak6 years agoSuper User
Anonymous , Both date are from the same table. So you do not need userelation for date diff.
In a new column = datediff(order[due Date], order[Shipped Date],DAY)
In a new measure= datediff(min(order[due Date]), Max(order[Shipped Date]),DAY) // Refer my blog for row context
Now use relation is which date you want to use when you display this. So on top of this formula, you can use one of the date.
Or can have two formula one for each date.