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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Number of days in random lines

I have a SQL table with a history of vehicle movements. Each line is a movement, with movement code, vehicle code, company of origin and destination, initial and final mileage, initial and final date and the vehicle status in that movement (example: leased, under maintenance, washing, etc.) .
I need to count the number of days that a vehicle takes from status x to another status y, and it may or may not pass through other statuses in that interval with varying number of days.
The table is neither separated nor ordered by vehicle.
Any tips where to start?

2 REPLIES 2
Anonymous
Not applicable

Without seeing a table with the data it's not possible to help you. Sorry.
Fowmy
Super User
Super User

@Anonymous 

Sure we can help you out,

Can you share some sample data and the expected result as data to have a clear understanding of your question?

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors