Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

waiting time display

hiii

i have applied this formula for wait time 

 
wait time = SECOND('Q2 Call Answering'[Disconnect Time] - 'Q2 Call Answering'[Connect Time] - 'Q2 Call Answering'[Hold Duration] - 'Q2 Call Answering'[Talk Duration])
i am getting output as 00:00:00 for all the columns its not displaying the waitime
can someone show me how can i display the wait time

8 Replies

  • Anonymous 

    To get the total in SECONDS try this as a new column in your table:

    wait time = 
       VAR S = ('Q2 Call Answering'[Disconnect Time] - 'Q2 Call Answering'[Connect Time] - 'Q2 Call 
       Answering'[Hold Duration] - 'Q2 Call Answering'[Talk Duration])
    RETURN
       S * 86400

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click on the Thumbs-Up icon on the right if you like this reply 🙂

    YouTube, LinkedIn

  • Anonymous , Try like

    new column =
    var _1 = (('Q2 Call Answering'[Disconnect Time] - 'Q2 Call Answering'[Connect Time]) - 'Q2 Call Answering'[Hold Duration] - 'Q2 Call Answering'[Talk Duration])
    return
    Minute( _1)*60 + SECOND( _1)

     

    If needed add code for hour

    • Anonymous's avatar
      Anonymous
      Not applicable

      hiii i tried applying ur code its been excuted succeesfully but i am get the same output

       

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        Anonymous 

        There are several replies to your question.
        Which reply are you referring to?

        ________________________

        Did I answer your question? Mark this post as a solution, this will help others!.

        Click on the Thumbs-Up icon on the right if you like this reply 🙂

        YouTube, LinkedIn

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous I'm not entirely sure what you are going for here. Can you post the data as text and what you expect to get as a result? 

     

    Please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

  • FrankAT's avatar
    FrankAT
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

    use the following formula:

     

    Wait Time = 
    'Q2 Call Answering'[Disconnect Time] - 
    'Q2 Call Answering'[Connect Time] - 
    'Q2 Call Answering'[Hold Duration] - 
    'Q2 Call Answering'[Talk Duration]

     

    and format the column data as marked (see figure):

     

     

    Regards FrankAT

    • Anonymous's avatar
      Anonymous
      Not applicable

      hiii frank

       

      i tried applying ur query its not displaying the in secs i think there a problem in out format can you help me plz

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi Anonymous , 

    You could calculate this in M code like below

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcuxEQAgCEPRXagtApomq3jsv4aoBXcpfvGyt3loUg4b5lDgJ0ThBfRmOcpSLBDXUqtubNJZIPMA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [disconnect = _t, connect = _t, hold = _t, duration = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"disconnect", type duration}, {"connect", type duration}, {"hold", type duration}, {"duration", type duration}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [disconnect]-[connect]-[hold]-[duration]),
        #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", type duration}}),
        #"Added Custom1" = Table.AddColumn(#"Changed Type1", "Custom.1", each Duration.TotalSeconds([Custom]))
    in
        #"Added Custom1"

     

     Then  change data format like below

    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.