Forum Discussion

spandy34's avatar
spandy34
Responsive Resident
4 years ago
Solved

Time field difference

I have the table below which includes two columns which are time fields.I want to add a column called Lost Time that subtracts the Actual_Duration_mins from the Comm_Duration_mins.  What will the DAX...
  • goncalogeraldes's avatar
    4 years ago

    Hello there spandy34 ! I figure that you are expecting a measure so here goes. 

     

    Hope this works for you:

    Lost Time =
    DATEDIFF (
        SELECTEDVALUE ( 'Table'[Actual_Duration_mins] ),
        SELECTEDVALUE ( 'Table'[Comm_Duration_mins] ),
        MINUTE
    )

     

    Hope this answer solves your problem!
    If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
    Thanks!

    You can also check out my LinkedIn!

    Best regards,
    Gonçalo Geraldes