Hi!
I am trying to get the average time for each work order but using an inactive relationship on my Calendar table based on the opening date.
My measures :
The opening date of the work order is not always in the same year as the transactions. In this case, when I filter my pivot table by year, it doesn't always work.
In the file I attached, the average for a work order opened in 2016 with transactions only in 2017 won't work.
Link to xlsx file
https://drive.google.com/file/d/0BxcndF-RTt_oWTRiR3ZVZG93dlE/view?usp=sharing
Thank you very much!
I am trying to get the average time for each work order but using an inactive relationship on my Calendar table based on the opening date.

My measures :
Code:
Total=SUM(Workorder[Hours])
Code:
Total3 - OpenDate=CALCULATE (
IF ( [Total] = 0, BLANK (), [Total] ),
USERELATIONSHIP ( Workorder[OpenDate], Calendar[Date] )
)
Code:
=Average=
AVERAGEX (
FILTER (
VALUES ( Workorder[WorkOrderId] ),
NOT ( ISBLANK ( [Total3 - OpenDate] ) )
),
[Total3 - OpenDate]
)
The opening date of the work order is not always in the same year as the transactions. In this case, when I filter my pivot table by year, it doesn't always work.
In the file I attached, the average for a work order opened in 2016 with transactions only in 2017 won't work.

Link to xlsx file
https://drive.google.com/file/d/0BxcndF-RTt_oWTRiR3ZVZG93dlE/view?usp=sharing
Thank you very much!
Last edited: