Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
Im very new to Power BI so may need some help explained in simple terms.
Within my data source I have <1000 rows of timesheet entries. For the most part, these are split into two columns, ‘Start Date Time” and “Finish Date Time”.
Im looking to sum these up and display the accumulated hours within the dashboard and wondered whats the best way to go about this.
I was thinking of creating a custom column in the power query editor to derive the time spent for each timesheet entry. Does this sound like a reasonable approach?
Thanks in advance.
Solved! Go to Solution.
Hi @Adam1V ,
I am not clear about your requirement, if you want to calculate datediff between start time and end time, you could try to use below M code to see whetehr it work ot not
Duration.Hours(Duration.From([End time]-[Start time])))
In addition, if possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Adam1V ,
I am not clear about your requirement, if you want to calculate datediff between start time and end time, you could try to use below M code to see whetehr it work ot not
Duration.Hours(Duration.From([End time]-[Start time])))
In addition, if possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Refer to my blog on a similar line, how to sum up data between two dates:https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
You could use DATEDIFF in a Calculated Column.
If you want the number to be positive:
Hours Difference = DATEDIFF([StartTime], [EndTime], HOUR)
If you want the number to be negative:
Hours Difference = DATEDIFF([EndTime], [StartTime], HOUR)
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |