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.
Hello Experts,
I do have below data sets in my Source Database table.
The standard in and out times of employees are from 08:00 A.M till 02:00 P.M.
Emp | Date | Ref_IN_Time | IN_Time | Ref_OUT_Time | OUT_Time |
101 | 5-Dec-18 | 8:00 | 8:50 | 14:00 | 12:10 |
102 | 5-Dec-18 | 8:00 | 9:00 | 14:00 | 13:30 |
103 | 5-Dec-18 | 8:00 | 10:45 | 14:00 | 11:30 |
104 | 5-Dec-18 | 8:00 | 8:00 | 14:00 | 14:00 |
105 | 5-Dec-18 | 8:00 | 8:00 | 14:00 | 14:00 |
for Example emp 101 is late for 50 Minutes in morning and he left early and he is late for 1 hour 50 Minutes in evening.
So in total ths employee is late for 2:40 2 hour and 40 Minutes for today.
In power BI I need to Calculate No of hours each employee he is absent in HH:MM
Emp | Date | Ref_IN_Time | IN_Time | Ref_OUT_Time | OUT_Time | Late | Status |
101 | 5-Dec-18 | 8:00 | 8:50 | 14:00 | 12:10 | 2:40 | Late |
102 | 5-Dec-18 | 8:00 | 9:00 | 14:00 | 13:30 | 1:30 | Late |
103 | 5-Dec-18 | 8:00 | 10:45 | 14:00 | 11:30 | 2:45 | Late |
104 | 5-Dec-18 | 8:00 | 8:00 | 14:00 | 14:00 | 0:00 | Ontime |
105 | 5-Dec-18 | 8:00 | 8:00 | 14:00 | 14:00 | 0:00 | Ontime
|
Now I need to Populate last 2 coulumns in power BI, Can somebody please provide there inputs on how to solve this.
Solved! Go to Solution.
I would do this in 3 columns:
Column = DATEDIFF([Ref_IN_Time],[IN_Time],MINUTE)+DATEDIFF([OUT_Time],[Ref_OUT_Time],MINUTE) Status = IF([Column]=0,"On Time","Late") Late = VAR __hours = INT([Column]/60) VAR __minutes = [Column] - 60*__hours RETURN CONCATENATE(CONCATENATE(__hours,":"),__minutes)
I would do this in 3 columns:
Column = DATEDIFF([Ref_IN_Time],[IN_Time],MINUTE)+DATEDIFF([OUT_Time],[Ref_OUT_Time],MINUTE) Status = IF([Column]=0,"On Time","Late") Late = VAR __hours = INT([Column]/60) VAR __minutes = [Column] - 60*__hours RETURN CONCATENATE(CONCATENATE(__hours,":"),__minutes)
Thank you @Greg_Deckler, It worked like a charm,
I do have one more question, But i will open another post for that.
Regards
ASHFAQ
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |