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
demonfc
Employee
Employee

Time difference HELP

Hello, 

 

I am looking to determine the difference in hours on a given day for a salesman who works that day. The expected result would be essentially be a seperate table with the salesmans name, the date, and the difference between the hours worked in that day. 

 

The table below is a sampling of the data but this would need to scale to around 1000 people. . 

 

Agent              CustomerName                      Date

BillyRandom Customer10/27/18 6:21 AM
BillyRandom Customer11/4/18 7:26 AM
BillyRandom Customer10/9/18 04:13:AM
BillyRandom Customer10/9/18 05:43:AM
BillyRandom Customer10/9/18 03:33:AM
BillyRandom Customer10/9/18 01:13:AM
BobRandom Customer10/27/18 12:27 AM
BobRandom Customer10/27/18 2:02 AM
BobRandom Customer10/27/18 4:26 AM
BobRandom Customer10/27/18 7:26 AM
BobRandom Customer10/27/18 7:26 PM
BobRandom Customer10/27/18 10:26 PM
BobRandom Customer10/11/18 7:16 AM
BobRandom Customer10/11/18 2:16:03PM
BobRandom Customer10/11/18 07:16:03PM
BobRandom Customer10/11/18 1:36:03PM
BobRandom Customer10/11/18 1:21:03PM
BobRandom Customer11/1/18 1:16 PM

 

Any help you can provide would be greatly appreciated. 

 

Thank you

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @demonfc,

 

In my opinion, I'd like to suggest you extract hour part from datetime column. Then you can create time table with time value from 0:00 to 23:00, build relationship from time table to new 'hour' column.

 

Column formula:

Hour = TIME(HOUR([Date]),0,0)

Calculate table formula:

Time table = GENERATESERIES(TIME(0,0,0),TIME(23,0,0),TIME(1,0,0))

 

After these steps, you can use time table column as axis, origin table column as value column create visuals with summarize original table values.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @demonfc,

 

In my opinion, I'd like to suggest you extract hour part from datetime column. Then you can create time table with time value from 0:00 to 23:00, build relationship from time table to new 'hour' column.

 

Column formula:

Hour = TIME(HOUR([Date]),0,0)

Calculate table formula:

Time table = GENERATESERIES(TIME(0,0,0),TIME(23,0,0),TIME(1,0,0))

 

After these steps, you can use time table column as axis, origin table column as value column create visuals with summarize original table values.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
sokg
Solution Supplier
Solution Supplier

Hello @demonfc

 

In order to determine the difference in hours you must have a start datetime and a end datetime.

In you date what is your start datetime and what is your end datetime???

Hi sokg, 

 

Basically, it would be a 24 hour date/time of any given day. Starting at 12:00:00 AM of any given day and ending at 11:59:59 PM that same day. 

 

Thank you for your help. 

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.