Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Userelationship

Hello  -  I am trying to use  userelationship to connect an inactive field.    Ultimately I want to determine the days difference between when orders were due, and when they shipped.  

 

I have two fields, both in the same table (Orders).    Both connected to a date table   -   one is active (due date) and one is inactive  (date shipped).   

 

Due Date vs Actual Ship = CALCULATE(DATEDIFF(USERELATIONSHIP('Date Table'[Date],Orders[Date Shipped]),XXXXX
 
I am trying to add the Due Date field (where the XXXXX's are), but this field does not show as an option.

I really need to have the "date shipped" relationship activated so that I can use the date table month,year, etc to control the slicers and visuals.
  • 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.

6 Replies