Search code examples
exceltimepowerpivotdax

Excel Powerpivot Dax(not native excel)- convert time to decimal hours


I have a list of times:

8:30PM
8:15PM
7:20PM

How can I convert these to decimal hours in Powerpivot (DAX)?

for example:

8.5
8.25
7.33

Solution

  • Use this formula DecimalNumber = Sheet1[DATE]*24, or simply multiply your time with 24. 8:30PM can never evaluate to 8:30 since it is PM, so it's actually 20:50. If you want it to be 8:50 instead, then subtract 12 from formula.

    enter image description here