Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217157

Dax to compare records in adjacent rows.

$
0
0

Hello,

 

I'm working on a system to report Outlook calendar events, mainly the type of event, the total time spent on each type of event and the total working hours of each team member. I use an add-in to export all the data into an Access file.

 

My problem is with overlapping events. Here is an example:

 

overlapping tasks.png

 

 

What I have in PBI is a query to combine reports from several team-members into a table and sort all events by 'Start'. I also have a calculated column named 'Day' to get only the date from the 'Start' datetime (example in Excel):

 

Excel.png

 

So, I would need something like:

 

 

WorkTime = IF( Event[End] > nextEvent[Start]); [Duration] - ((Event[End] - nextEvent[Start]) / 2); [Duration])

 

 

This is meant to subtract half of the overlapping time to both overlapping events.

And this would have to be filtered by 'Day' and 'EmployeeID'.

 

I am aware this would have to be completed with further conditions to account for other overlapping situations, but at this point I'm concerned with the method to compare adjacent records.

 

Can someone get me started on this?

 

Thank you,

 

 

Tiago Jordão

 

 

 


Viewing all articles
Browse latest Browse all 217157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>