Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I want to find how many hours trailers is at my warehouse. In my document I know when a driver come whit a trailer and when is go out whit different trailer.
In my PowerBI, I find how to calculate hours, but I want to filter trailers was already gone.
Do someone have any suggestion,
Thank's
Solved! Go to Solution.
Hi @alexandrerich ,
You can use merge.
1.Duplicate the main table out of a new table, then retain the ID and time of the old table, and retain the ID and time of the new one, and then merge.
2.Then expand the table
3.Then add custom column to calculate the difference.
4.Convert the column to total hours.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@alexandrerich Not certain but seems like MTBF-type of problem. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
Might help with sample data as text and explanation of which column is which.
Hi Greg, ,
The problem is my trailer OUT and IN is not in the same line. See example
| Date IN | Trailer In | Trailer Out | Date out |
| 2021-09-11 8:00 | 4834 | 4828 | 2021-09-12 8:00 |
| 2021-09-12 8:00 | 1546 | 1836 | 2021-09-13 8:00 |
| 2021-09-12 8:00 | 4823 | 1546 | 2021-09-13 8:00 |
| 2021-09-12 8:00 | 1625 | 75189 | 2021-09-13 8:00 |
| 2021-09-12 8:00 | 61413 | 4834 | 2021-09-13 8:00 |
And I dont want see trailer was go out.
I find how to have how many hour trailers is here at the present time, But I want to erase trailers is gone.
Hi @alexandrerich ,
You can use merge.
1.Duplicate the main table out of a new table, then retain the ID and time of the old table, and retain the ID and time of the new one, and then merge.
2.Then expand the table
3.Then add custom column to calculate the difference.
4.Convert the column to total hours.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank's, is exactly what I search
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |