Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Average lead time

Hello all,

 

I'm trying to figure out how to show my average lead time, changeable with whatever the user selects as filter (year, type of ticket, drill down deeper into a year for months etc.) as a card visual, or any other. With the result I want to have being something like: 2017 selected. Lead time displayed: 104:44 (or just 104 hours). 

Right now I have the following, where every timestamp is the lead time for one ticket/record: 

In the database this is registered as seconds, so I converted it to a HH:MM:SS format with the column set as time. I tried 

Doorlooptijd = AVERAGE(Incidents[Timehour]) but this doesn't work. Any idea's? 
 
 
  • Hi  Anonymous ,

     

    Using your oringinal data "Seconds" for calculation would be better.

    Create 2 measures as below:

    average = AVERAGEX(ALLSELECTED('Table'),'Table'[Seconds])
    format = 
    var _hour=INT('Table'[average]/3600)
    var _min=INT(DIVIDE('Table'[average]-_hour*3600,60))
    var _sec=INT('Table'[average]-_hour*3600-_min*60)
    Return
    _hour&":"&_min&":"&_sec

    And you would see:

    For my related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

5 Replies