Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
chemmario
Frequent Visitor

Choose minimum date and maximum date for every ID

Hi guys, I'm working with a table like the following: 

 

Start DateVehicle NrUser Name 
01 01 2020001Max
05 02 2020 (he renewed his contract)001Max
03 03 2020 (which is the End date for Max using vehicle 001) 001 Kim
02 01 2020002Max
05 05 2020002Jana 
05 06 2020001 Max
05 10 2020001 Marc 

 

 

I need to create a table that shows how long the user used the vehicle: 

UserVehicle NrStart dateEnd date 
Max 00101 01 2020   03 03 2020
Kim 00103 03 2020  05 06 2020 
Max002 02 01 2020  05 05 2020
Max001 05 06 2020  05 10 2020

 

 

It's very complex to find a solution for that, I would be thankful for anything! Thank you!

3 REPLIES 3
amitchandak
Super User
Super User

@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 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.