Forum Discussion
Power Bi Desktop staff activities time sheet
- 4 years ago
Thanks for reaching out to us.
Does your data source have an activity id field? If not, you need to increase it, otherwise it is impossible to distinguish different activities with overlapping time
Sample data
create 2 measures, DAX code:
time = DATEDIFF( MIN('Table'[Activity Start Time]),MIN('Table'[Activity End Time]),MINUTE)/60Measure = var _activityID=SELECTEDVALUE('Table'[activity ID]) var _time=MAXX(FILTER(ALL('Table'),'Table'[activity ID]=_activityID),[time]) var _staffname= SELECTEDVALUE('Table'[Staff Name]) return "Staff Name: "&_staffname&UNICHAR(10)&"activity ID: "&_activityID&UNICHAR(10)&"time: "&_timeresult
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thanks for reaching out to us.
Does your data source have an activity id field? If not, you need to increase it, otherwise it is impossible to distinguish different activities with overlapping time
Sample data
create 2 measures, DAX code:
time = DATEDIFF( MIN('Table'[Activity Start Time]),MIN('Table'[Activity End Time]),MINUTE)/60Measure =
var _activityID=SELECTEDVALUE('Table'[activity ID])
var _time=MAXX(FILTER(ALL('Table'),'Table'[activity ID]=_activityID),[time])
var _staffname= SELECTEDVALUE('Table'[Staff Name])
return "Staff Name: "&_staffname&UNICHAR(10)&"activity ID: "&_activityID&UNICHAR(10)&"time: "&_time
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Not sure if you managed to see my reply to this perhaps?