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.
Hi guys, I'm working with a table like the following:
Start Date | Vehicle Nr | User Name |
01 01 2020 | 001 | Max |
05 02 2020 (he renewed his contract) | 001 | Max |
03 03 2020 (which is the End date for Max using vehicle 001) | 001 | Kim |
02 01 2020 | 002 | Max |
05 05 2020 | 002 | Jana |
05 06 2020 | 001 | Max |
05 10 2020 | 001 | Marc |
I need to create a table that shows how long the user used the vehicle:
User | Vehicle Nr | Start date | End date |
Max | 001 | 01 01 2020 | 03 03 2020 |
Kim | 001 | 03 03 2020 | 05 06 2020 |
Max | 002 | 02 01 2020 | 05 05 2020 |
Max | 001 | 05 06 2020 | 05 10 2020 |
It's very complex to find a solution for that, I would be thankful for anything! Thank you!
@chemmario , is first and last, is not for the same user, same Vehicle ?
How do we decide where to stop max and start min again
The problem is that a user can rent that car a second time and there will be a second Start and End Date, so you cant solve it by just focussing on the Max date
You need to pick up the start date and look for the next bigger date for the same vehicle with a different user. That would be the end date for the first period
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 |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |