Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to convert date time to decimal

How to convert date time to decimal so that the time can be presented on a trendline

I have this column (Completion Time):

 

justyna_kmiecik_0-1654091715367.png

I would like to see as a result: 5.58 for exampl if the completion time is 5:58 or some kind of alternative that allows me to use this field to presnet in a trendline completion time by month and calculate YTD completion time etc.

 

I tried using convert but I do not like the result I see:

Completion_Time = CONVERT('Daily Issues'[Completion time],DOUBLE)
 
justyna_kmiecik_1-1654092564277.png

 

 

 

Thanks!

 
 

 

4 REPLIES 4
Anonymous
Not applicable

thanks for feedback. Completion Time is just a column and not a measure and therefore power bi doesnt accept it in the formula..do you have another solution?

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You could create a column as below:-

Column = round(FORMAT('Table (6)'[Completion tme],"HH")&"."&FORMAT('Table (6)'[Completion tme],"NN"),2)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi, I managed to create a new measure, however it looks like text. How can I convert it to double (round can not work as it is text):

Completion_Time = FORMAT(CONVERT('Daily Issues'[Completion time],DOUBLE),"HH")&"."&FORMAT(CONVERT('Daily Issues'[Completion time],DOUBLE),"NN")
 
 
 
justyna_kmiecik_0-1655133903316.png

 

 

justyna_kmiecik_2-1655134049741.png

 

 

justyna_kmiecik_4-1655134118113.png

 

 

@Anonymous Please create a column only. I have updated the code as per your table name. Please try this:-

Column =
ROUND (
    FORMAT ( 'Daily Issues'[Completion_time], "HH" ) & "."
        & FORMAT ( 'Daily Issues'[Completion_time], "NN" ),
    2
)

Note:- I have considered the completion_time as column only.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.