Forum Discussion

BoPowerBI's avatar
BoPowerBI
Frequent Visitor
6 years ago

Average time calculation, calculated column or measure?

Hi all,

 

I'm trying to get my head around PowerBI and measures and I couldn't find an answer, please help.

 

This is an excerpt from my datatable of 18th of June 2020 during different time slots:

 

NumCallsWaitingTimeAvg
800:00:18
1000:00:20
500:00:08
500:00:05
400:00:04
600:00:33
1000:00:05
1700:00:31
400:00:12

 

I'm trying to calculate the average number of seconds waiting time on that day. Question:

1. Is it best practice to add a Calculated Column or a Measure?

2. What would the Measure look like?

 

Note on question 2: 

If I use this:

 

MEASURE = SUM(Table[WaitingTimeAvg]*86400)

 

I don't get the right answer since it should be doing (NumCalls * WaitingTimeAvg) / NumCalls. But if I use this:

 

MEASURE = (SUM(Table[NumCalls]) * SUM(Table[WaitingTimeAvg]*86400)) / SUM(Table[NumCalls])

 

 it doesn't work either... I would really like to understand what's going on. 

 

Can someone give me some clarity on my way to a PowerBI pro?

Thanks!

9 Replies