Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Daven
Helper II
Helper II

Time difference from same column

Hi,

 

I have call details table and want to see avg time difference if "called from" is same number. I.e for below, avg time difference for called from # 1 is 3 hrs.

 

Call start time# called fromAvg call time diff (HH: MM)
11/9/2019 15:4513 hrs
11/9/2019 20:4513 hrs
11/9/2019 21:4513 hrs
11/9/2019 06:1020 hrs
11/9/2019 7:203o hrs

 

Thanks in advance 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi Daven, 

It seems that you want to getAbvg call time value, right? If so, you could refer to my sample. If not, please  correct me and inform me more detailed information (such as your sample data and your expected output), then I will help you more correctly.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
dax
Community Support
Community Support

Hi Daven, 

It seems that you want to getAbvg call time value, right? If so, you could refer to my sample. If not, please  correct me and inform me more detailed information (such as your sample data and your expected output), then I will help you more correctly.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi Zoe, 

 

Your solution works. Thank you.

 

Is it possible to get avg time diff only of the call start time is on same date? Otherwise null result

 

 

I added a different date in the sample data here. https://drive.google.com/file/d/1-yejDy7-ooElRygQ-0N-vOlf4jPOynYr/view?usp=sharing

 

Thanks,

Daven

 

dax
Community Support
Community Support

Hi Daven, 

You could create calculated column like below , then use below measure to see whether it work or not

Column = T3[Call start time].[Year]*10000+T3[Call start time].[MonthNo]*100+T3[Call start time].[Day]
Measure 4 = VAR COUNTAMOUNT=CALCULATE(COUNT(T3[Call start time]),FILTER(ALL(T3), T3[Column]=MIN(T3[Column]))) VAR MAXT=CALCULATE(MAX(T3[Call start time]), FILTER(ALL(T3), T3[Column]=MIN(T3[Column]))) VAR MINT=CALCULATE(MIN(T3[Call start time]),FILTER(ALL(T3), T3[Column]=MIN(T3[Column])))  RETURN IF(COUNTAMOUNT>1, DATEDIFF(MINT,MAXT,HOUR)/(COUNTAMOUNT-1),0)

 535.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bchager6
Super User
Super User

Here's a simple and straightforward solution with the results shown in slicers and a table:

Using this measure: 

Avg. Time Difference = AVERAGE ( 'Table'[Avg call time diff (HH: MM)])
 
Slicer
slicer.JPG

 

Slicer
slicer2.JPG
Table
table.JPG

 

parry2k
Super User
Super User

@Daven Seems like data is not complete, you have call start time but no end time, how you calculated the avg?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.