Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
Can somebody help me to find solution:
I have column Start Date with time and End Date with time, i got result working time (END.Date-Start.DATE), but as you see working can start 12/29/2023 9:02:00 AM, and end next month 1/3/2024 1:27:00 PM, so in total it it 5.18 days... but how to assign this days to December and January, i mean to split it. also need to split by truck number, as you see?
Any solution please? I tried to make date list.. but dont help me, because it is date with time...
In final result i want to see each truck each month how many time they worked.
Solved! Go to Solution.
Hi @meduza ,
I create a table as you mentioned.
Then I create a calculated column.
Minutes = DATEDIFF('Table'[Start date],'Table'[End date],HOUR)
Finally I create a measure and get what you want.
Measure =
SUMX (
DISTINCT ( 'Table'[Truck] ),
CALCULATE ( SUM ( 'Table'[Hours] ), ALLEXCEPT ( 'Table', 'Table'[Truck] ) )
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
All good, i found solution 🙂
thanks!
Thank you for time and trying to help me.
But we don't get finally what we want, i mean like truck KML296, we know that it worked 2023-12-29 09:02am till 2024-01-03 13:27pm, in total 124 hours, but we dont know how many hours was in December/2023, and January/2024.
I want to see each truck, how many hours worked each month, so this sum of hours we need to split in months, to get correct result, because started one month and ended in different month... In final table i want to see like truck KML296, December/2023, worked x hours, and January x hours... to sum hours and group by months
I hope you get what i mean 🙂 Please let me know if you can help me
thank you
Hi @meduza ,
I create a table as you mentioned.
Then I create a calculated column.
Minutes = DATEDIFF('Table'[Start date],'Table'[End date],HOUR)
Finally I create a measure and get what you want.
Measure =
SUMX (
DISTINCT ( 'Table'[Truck] ),
CALCULATE ( SUM ( 'Table'[Hours] ), ALLEXCEPT ( 'Table', 'Table'[Truck] ) )
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
85 | |
81 | |
64 | |
53 | |
46 |
User | Count |
---|---|
102 | |
50 | |
42 | |
39 | |
38 |