Forum Discussion
Help with query across tables
Hi, FlowViz
Create the following measures:
_selectedDate =
var _date=SELECTEDVALUE('Dates'[Date])
return
Date(
year(_date),MONTH(_date),DAY(_date))_isIn =
var _selectedDate=[_selectedDate]
var _currentStatus=SELECTEDVALUE('CycleTime (2)'[NewStatus])
var _ChangeDate=SELECTEDVALUE('CycleTime (2)'[ChangedDate])
var _dateStart=DATE(YEAR(_ChangeDate),MONTH(_ChangeDate),DAY(_ChangeDate))
var _CompletedDate=SELECTEDVALUE('CycleTime (2)'[CompletedDate])
var _dateEnd=DATE(YEAR(_CompletedDate),MONTH(_CompletedDate),DAY(_CompletedDate))
var _if=
IF(
_currentStatus<>"Done"&&
AND(_selectedDate>=_dateStart,_selectedDate<=_dateEnd),1,0
)
return _if_count = SUMX('CycleTime (2)',CALCULATE([_isIn]))_age =
IF([_isIn]=0,BLANK(),DATEDIFF(SELECTEDVALUE('CycleTime (2)'[ChangedDate]),[_selectedDate],DAY))
Result:
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- FlowViz4 years agoHelper III
Thank you!
One final question - if there have been no changes to items then there will be no updates to the history, however they will still be 'In Progress'. So if my current chart now looks like this:
It should stay at the value of 3 for the 22/23/24/25 March.
Is there anyway to do this?
- v-angzheng-msft4 years agoCommunity Support
Hi, FlowViz
Try to create another measure like this:
_sum = SUMX(FILTER(ALLSELECTED('CycleTime (2)'),'CycleTime (2)'[ChangedDate]<=MAX('CycleTime (2)'[ChangedDate])),[_count])Result:
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.