title: Tableau - How to calculate date/time difference and result in full date/time?
body: <p>I'm trying to calculate a difference between connection time and disconnected time. See image below. But DATEPART formula that I'm using only allows me to use one parameter (hour, minute, second,...)</p>
  
  <p>However, as in the image, I have an ID where disconnection at 3/1/17 2:35:22PM and connection back at 3/2/17 1:59:38 PM</p>
  
  <p>Ideal Response: 23 hours, 24 minutes and 16 seconds</p>
  
  <p>but using the formula:</p>
  
  <pre><code>ZN(LOOKUP(ATTR(DATEPART('minute', [Disconnected At])),-1)-(ATTR(DATEPART('minute', [Connected At]))))
  </code></pre>
  
  <p>it isn't doing the trick.</p>
  
  <p>Could someone help me to achieve my ideal response? Or similar result that would give me the completeness of date and time?</p>
  
  <p>Thank You</p>
  
  <p><a href="https://i.stack.imgur.com/DP3x6.png" rel="nofollow noreferrer">Tableau ScreenShot</a></p>