Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
who can help me?
I have a table like this:
Employee id | typy | date | time |
1010 | Enty | 8/31/2020 | 7:30:00 AM |
1010 | exit | 8/31/2020 | 8:34:26 AM |
1010 | entry | 8/31/2020 | 8:36:14 AM |
1010 | exit | 8/31/2020 | 12:36:21 PM |
123 | Enty | 8/31/2020 | 7:45:16 AM |
123 | exit | 8/31/2020 | 9:45:16 AM |
123 | entry | 8/31/2020 | 9:55:16 AM |
123 | exit | 8/31/2020 | 4:55:16 PM |
123 | Enty | 8/31/2020 | 5:10:16 PM |
123 | exit | 8/31/2020 | 8:14:56 PM |
4020 | entry | 8/31/2020 | 6:14:56 PM |
4020 | exit | 8/31/2020 | 7:14:56 PM |
4020 | entry | 8/31/2020 | 7:19:51 PM |
4020 | exit | 8/31/2020 | 8:14:56 PM |
4020 | entry | 8/31/2020 | 8:24:56 PM |
4020 | exit | 9/1/2020 | 1:14:56 AM |
and i need to calculate networking hours per day for each employee ID
NOTE : FOR THIRD SHIFT Exit date is = entry day +1
thanks
@Anonymous , In case of date-time is not a single column have one column like
date time =[date] +[time]
Create a new column , that will timefrom entry to exit
if([type] ="exit", datediff(maxx(filter(Table, [Employee id] =earlier([Employee id]) && [date time] <earlier([date time]) && [type] <> earlier([type] )),[date time] ),[date time] ,hour),blank())
@Anonymous I created something for that once: https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Duration-Working-Hours/m-p/481543#M182
In your case, you will also need to find the right time pairs, you can do that with the techinques in MTBF. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __Previous = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Value])
RETURN
__Current - __Previous
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |