Forum Discussion

AmiA's avatar
AmiA
Regular Visitor
5 years ago
Solved

Average call time measure

Hi everyone   I have created a measure for average call time but it is only available as a tooltip rather than being able to use it as values. Any ideas?    
  • v-jingzhang's avatar
    v-jingzhang
    5 years ago

    Hi AmiA 

     

    The thing is that there is no duration data type in Power BI report. When you use average('table'[call time]), it doesn't return the correct average duration of calls if call time is of time data type. You need to do some calculation to convert call time to numeric data type with unit hour, minute or second, then calculate the average of them. After that, format it into what you like. 

     

    Here is Greg's blog that may help: Aggregating Duration/Time - Microsoft Power BI Community

     

    Another thing is that when you format the duration time like "hh:mm:ss", it will be changed into text data type while text data type field cannot be put into some visuals as Values because it cannot be used in some calculations. If you put it in visuals like table/card/matrix... which can accept text data, it would be ok. If you put it in visuals like column chart/line chart... that compares the size of data, it would be not possible. You need to remove its format to keep it in numeric data type so that it can be used in these visuals. 

     

    I know this is not very ideal but I cannot find perfect solution to it currently. Please vote for this idea: Microsoft Idea  · field of "duration" type

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.