The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am struggling to display some time based data on a line chart using PowerBI Desktop and haven't had any luck searching for a solution.
I have data as per the small sample below from a timesheet system displaying the Date, staffID, Clock in Time, Clock Out time.
I am looking to create a line chart displaying time of day on the X axis and number of staff on site on the Y axis for an individual day.
ANy help or a point in the right direction would be appreciated.
Date | StaffID | ManTimeIn | ManTimeOut |
4/4/17 0:00 | 3765 | 4/4/17 7:00 | 4/4/17 16:54 |
4/4/17 0:00 | 3942 | 4/4/17 7:00 | 4/4/17 15:30 |
4/4/17 0:00 | 4039 | 4/4/17 7:00 | 4/4/17 15:30 |
4/4/17 0:00 | 5191 | 4/4/17 7:00 | 4/4/17 16:54 |
4/4/17 0:00 | 5083 | 4/4/17 7:01 | 4/4/17 16:22 |
4/4/17 0:00 | 5163 | 4/4/17 7:01 | 4/4/17 13:54 |
4/4/17 0:00 | 3224 | 4/4/17 7:15 | 4/4/17 15:42 |
4/4/17 0:00 | 5442 | 4/4/17 7:15 | 4/4/17 16:32 |
4/4/17 0:00 | 5601 | 4/4/17 7:15 | 4/4/17 15:55 |
4/4/17 0:00 | 3941 | 4/4/17 7:18 | 4/4/17 16:38 |
4/4/17 0:00 | 3845 | 4/4/17 7:30 | 4/4/17 15:15 |
4/4/17 0:00 | 3647 | 4/4/17 7:33 | 4/4/17 15:08 |
4/4/17 0:00 | 5057 | 4/4/17 7:33 | 4/4/17 14:39 |
If you've added the datetime to the Axis, it may be defaulting to a default date hierarchy. Try the setup in this screenshot as a starting point, and after adding the datetime field, click on the arrow and select the time value from the menu.
Thanks deldersveld,
I can produce your results above, the key issue is the 'running sum' of the number of employees on site rather than simply graphing the time they clock on.
In your example below, at 7:30 i should be showing 9 staff on site, sorry if that wasn't clear in the first post.
I am expecting the result to look a lot like a bell curve.