Forum Discussion
BoPowerBI
6 years agoFrequent Visitor
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...
amitchandak
Super User
6 years agoYou have to try like
MEASURE = divide(SUMX(Table[NumCalls] *Table[WaitingTimeAvg]*86400),SUM(Table[NumCalls]))
But prefer have avg time in sec or hour and use that
refer
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
- BoPowerBI6 years agoFrequent Visitor
Awesome amitchandak! Just curious: why do you use
DIVIDE(3, 2) = 1,5
instead of
3 / 2 = 1,5
Thanks for your help.
- amitchandak6 years ago
Super User
@BoPowerBI , Not sure I got you.
But Multiplication should be Sum(A*B) not sum(A) * sum(B) . If we want sum(A) * sum(B), we should force a row context
Similarly, divide should be sum(A)/ sum(B) not Sum(A/B) . A/B is done when you want a simple Avg
- BoPowerBI6 years agoFrequent Visitor
I just meant the difference between mine without divide:
WaitingTimeAvgSec = SUMX(WaitingTable,WaitingTable[NumCalls] * WaitingTable[WaitingTimeAvg] * 86400) / SUM(WaitingTable[NumCalls]and yours with divide:
MEASURE = divide(SUMX(Table[NumCalls] *Table[WaitingTimeAvg]*86400),SUM(Table[NumCalls]))