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
rammy
Helper I
Helper I

Regarding of decimal column to time

rammy_0-1638433908469.png

Hi sir 
I am Ramesh ,  Recently 
I got a job but as of now i have one problem regarding of  one column
Here i was extracted the table from sql and try to convert decimal column to time ,i got an error
and i have again convert that from decimal to duration and  i sum the entire column to know the worker spending time per day or week  but it will show as trillion values. how to see the hours data and how to convert the data into hours mode as per client requirements
please help me soon  in this find the  attachments it will give much clarity 
Thanks in Advance 
1 ACCEPTED SOLUTION

Hi, @rammy 

What format do you want to convert the column to?  HH:MM:SS? Since the values in the column represent hours, if you only want to get the total hours, then you can get the total hours directly by using the group by under transform tab. If you convert to duration, then please note that the unit of the value will be days instead of hours.

vangzhengmsft_1-1638958614889.png

 

In short, if you want to get the total hours, then directly sum the values in the column. You can use the group by mentioned above
If you need to format the summed value in the form of HH:MM:SS, then additional steps are required.

vangzhengmsft_0-1638958598524.png

 

Please refer to the attachment below for details. Hope this helps.

 

If I did not understand your question correctly, please post expected result or draw a simple picture to show your expected visual so that I may work out with a workaround.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-angzheng-msft
Community Support
Community Support

Hi, @rammy 

 

Glad to help.

It would be better if you could post the solution here which will benefit other users who might have the same issue.

And you can mark your solution as an answer.
If my posting is helpful to you, you can also mark my posting as an answer if you allow.😀

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-angzheng-msft
Community Support
Community Support

Hi, @rammy 

Could you please consdier sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.
It makes it easier to give you a solution.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

yeah i have a hour column that is in decimal format .i want that column to transform into hours  like spent hours ex a person spent 1 hour in this work and some other work he spent 5 hours .in this  way that decimal column have to be reflect.

 

see the colmn

 

rammy_0-1638932808074.png

 

Hi, @rammy 

What format do you want to convert the column to?  HH:MM:SS? Since the values in the column represent hours, if you only want to get the total hours, then you can get the total hours directly by using the group by under transform tab. If you convert to duration, then please note that the unit of the value will be days instead of hours.

vangzhengmsft_1-1638958614889.png

 

In short, if you want to get the total hours, then directly sum the values in the column. You can use the group by mentioned above
If you need to format the summed value in the form of HH:MM:SS, then additional steps are required.

vangzhengmsft_0-1638958598524.png

 

Please refer to the attachment below for details. Hope this helps.

 

If I did not understand your question correctly, please post expected result or draw a simple picture to show your expected visual so that I may work out with a workaround.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 
 
mahoneypat
Employee
Employee

Please see this article. The best approach is to keep your column as decimal, do your aggregation, and then format it at the end as described in the article.

Calculate and Format Durations in DAX – Hoosier BI

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


actually i havee only one decimal long value column .This column i want figure out how much time spent on each activity like in this date he spent 2 hrs ,1 hrs,30 min like wise.

that decimal column having time alredy lik e 2hrs,1 hrs ,30 min ,1:30 min like this values are already there in that decimal column i just need that column to converted into time and using sum fun function to know spent time on each activity .but it is in decimal way  please help me  mahoneypat

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.

Top Solution Authors