Forum Discussion
Anonymous
3 years agoNot applicable
Calculate Days Between
I am trying to count the day difference between the End Date on one Area compared to the Start Date of the next Area by Equipment based on a slicer selection for the Equipment being assigned to the A...
- Anonymous3 years ago
Hi Anonymous
You can refer to the following measure:
STAND_BY_DAYS = var _lastarea=MAXX(FILTER(ALLSELECTED('Table'),[EQUIPMENT]=MAX([EQUIPMENT])&&[AREA]<MAX([AREA])),[AREA]) var _lastenddate=MAXX(FILTER(ALLSELECTED('Table'),[AREA]=_lastarea&&[EQUIPMENT]=MAX([EQUIPMENT])),[END_DATE]) var _currentstartdate=MINX(FILTER(ALLSELECTED('Table'),[AREA]=MAX([AREA])&&[EQUIPMENT]=MAX([EQUIPMENT])),[START_DATE]) return IF(MAX('Table'[START_DATE])=_currentstartdate,DATEDIFF(_lastenddate,_currentstartdate,DAY))Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi Anonymous
You can refer to the following measure:
STAND_BY_DAYS = var _lastarea=MAXX(FILTER(ALLSELECTED('Table'),[EQUIPMENT]=MAX([EQUIPMENT])&&[AREA]<MAX([AREA])),[AREA])
var _lastenddate=MAXX(FILTER(ALLSELECTED('Table'),[AREA]=_lastarea&&[EQUIPMENT]=MAX([EQUIPMENT])),[END_DATE])
var _currentstartdate=MINX(FILTER(ALLSELECTED('Table'),[AREA]=MAX([AREA])&&[EQUIPMENT]=MAX([EQUIPMENT])),[START_DATE])
return IF(MAX('Table'[START_DATE])=_currentstartdate,DATEDIFF(_lastenddate,_currentstartdate,DAY))
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Thanks Yolo.
How about a measure to referance the STAND_BY_DAYS and divide by the job count per area and distibute to the jobs accordingly?