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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Targets showing as time

Hiya,

 

I am hoping some can point me in the right direction.

 

I am trying to convert into time format based on the total number completed/target

 

In excel I have used sum(Total_completed/target)/24 and then changed the format of the cell as time and it has worked. However I am struggling to get the same result in Power BI.

 

At the moment I have 2 measures [total Manual#]/[Manual Target]

 

Thanks a lot.

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Can you supply the sample data as a file or at least copy/paste a table so I don't have to manually type everything in again?

Please explain what you want to do with the Main Data table.  Am I supposed to be counting something here?  Is this where the Total Completed comes from?

Thanks

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @Anonymous 

Please supply some sample data and what you want the result to look like.

In PBI there is no Time data type, so you can end up storing time/durations as numbers indicating the total number of minutes or hours and then converting those to some human readable format like hh:mm:ss.  To do this requires some DAX code like this

HMS = 

VAR _time = SELECTEDVALUE('Table'[Minutes])

VAR _hrs = _time / 60 //(Elapsed_Time - days) * 24

VAR hrs = INT(_hrs) 

VAR mins = ROUND((_hrs - hrs) * 60, 0)

RETURN

FORMAT(hrs,"00") & ":" & FORMAT(mins,"00") & ":00 " 

Which will convert minutes like this

hms.png

If you can post some data I'll be happy to help.

regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Philip,

 

Thanks for coming back to me, apologies for not replying sooner.

 

The sample data looks like this.

 

Main Data

ClaireF_0-1616666327458.png

 

Target

ClaireF_1-1616666346415.png

 

 

Summary

ClaireF_2-1616666359518.png

 

 

Thanks again for your help.

 

Claire

Anonymous
Not applicable

Hi Philip,

 

Apologies I also have a measure which is a sum in HH:MM:SS time they had to to the work.

 

Thanks,

Claire

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors