Forum Discussion
arulmurugavel
Helper I
6 years agoDate Difference Should show value in Decimal
Hey Guys..
I hope that you and your family members are safe & Healthy in this COVID Situation.
I need a help in calculating difference between two datetime in Power BI.
I used Datediff function ,I want the table to be like this.
| Date1 | Date2 | What i am getting | What i want to get |
| 02-08-2019 13:42:00 | 03-08-2019 14:42:00 | 1 | 1.046 |
| 02-08-2019 13:42:00 | 02-08-2019 19:42:00 | 0 | 0.250 |
| 02-08-2019 13:42:00 | 02-08-2019 13:45:00 | 0 | 0.000 |
Please let me know if there is any way to achieve this.
Thanks & Regards,
arulmurugavel , if it is a day diff, you can also do like
datediff([date1],[date2],hour)/24.0
3 Replies
- Greg_Deckler
Community Champion
Use:
( [Date1] - [Date2]) * 1.
Make sure it is decimal and increase your decimal places appropriately.
- amitchandak
Super User
arulmurugavel , if it is a day diff, you can also do like
datediff([date1],[date2],hour)/24.0
- arulmurugavel
Helper I
It works great...Thanks amitchandak.