Forum Discussion
sort the date
hi v-piga-msft
when I create a new calculated column as a copy of measure, I am getting only one same value for all records...
AvgTurnaroundTimeForPendingTask =
VAR dayNo =
INT ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) / 1440 )
VAR hourNo =
INT (
MOD ( ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) ), 1440 ) / 60
)
VAR minuteNO =
MOD (
MOD ( ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) ), 1440 ),
60
)
VAR days =
IF ( dayNo > 1, dayNO & " Days ", IF ( dayNo = 1, dayNO & " Day " ) )
VAR hrs =
IF (
hourNo,
FORMAT ( hourNo, "#0" ) & " Hrs ",
IF ( hourNo = 1, FORMAT ( hourNo, "#0" ) & " Hr " )
)
VAR mins =
IF (
minuteNO > 1,
FORMAT ( minuteNo, "#0" ) & " Mins",
IF ( minuteNO = 1, FORMAT ( minuteNo, "#0" ) & " Min", IF ( minuteNO = 0, "" ) )
)
RETURN
CONCATENATE ( days, CONCATENATE ( hrs, mins ) )
hi v-piga-msft any idea??
- v-piga-msft7 years agoResident Rockstar
Hi Anonymous,
I'm afraid that should be caused by the context.
You could modify your fomula like below.
VAR dayNo = INT ( Calculate(AVERAGE ( 'Task Query'[task_pending_datediff_minutes],ALLEXCEPT('Task Query','Task Query'[Column name])) / 1440 )Here is an example which may help you understand the difference.
If you still need help, please share some data sample and your desired output so that we can help further on it.
Best Regards,
Cherry