Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I have these two-time columns and I want to calculate the total hour's difference In the new custom column.
I took the difference but values are coming in minus. pls, help me to fix this.
i also need to take the difference of hours spent- required hours (9.6). could u tell me how to do this?
my table name here is timesheet.
Solved! Go to Solution.
@raimon thanks for the help. It's working fine. could you tell me what changes I have to make to get the output like this 9.6, 10.12, 10.30 as hours difference, currently I am getting a whole number.
Hi , @RAKESH1986
You can try to use this M code:
Duration.Hours([Time Out]-[Time in])+ Duration.Minutes([Time Out]-[Time in])/60
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@raimon thanks for the help. It's working fine. could you tell me what changes I have to make to get the output like this 9.6, 10.12, 10.30 as hours difference, currently I am getting a whole number.
Hi , @RAKESH1986
You can try to use this M code:
Duration.Hours([Time Out]-[Time in])+ Duration.Minutes([Time Out]-[Time in])/60
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @RAKESH1986,
while calculating the difference add this function which will convert it into hours -
Duration.Hours([Time Out]-[Time In])
See below for reference -
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |