Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all.
First or all, let me tell you that I went through several posts with similar questions but I couldn't solve the issue anyway. So I am seeking for help here. And I am coming back to PowerBI after some months of travelling so I am not at my best shape
I am working with data about vehicle trips. Each vehicle only does one trip per day. Each trip might have several stops, hence the multiple start and end times for each vehicle per day.
I want to get info about the average trip time, average stop time, stops per trip, average stops per trip, all of this per vehicle and per day.
I am working with a set of data that looks like this:
First question: is is well processed? Should I use another structure? This structure confuses me to be honest.
So far, I could only work on the trip time. I created this measure: TripLengthHours = DATEDIFF(MIN(Trips[TripStartTime]),MAX(Trips[TripEndTime]),SECOND)/3600
For individual values, it works good, but on a matrix, the Total values obviously go mad:
Second question: what is wrong with the measure or the thinking (probably a lot)?
Third question: could you help me with the remaining values I am looking for?
Thanks a lot in advance.
Solved! Go to Solution.
@Anonymous,
You may try a similar way as shown here.
@Anonymous,
You may try a similar way as shown here.
Works like a charm, thank you.
In the meantime, I am trying to improve the file for the other calculations, could you take a look at this please?
https://community.powerbi.com/t5/Desktop/Calculation-over-rows-with-condition/td-p/325152
Thanks again!
Some improvising?
I'm trying
TripLengthHours = DATEDIFF(
CALCULATE(MIN(Trips[Value]),Trips[Attribute]="TripStartTime"),
CALCULATE(MAX(Trips[Value]),Trips[Attribute]="TripEndTime"),
SECOND)/3600
Same problem, of course.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
96 | |
90 | |
79 | |
68 |
User | Count |
---|---|
151 | |
121 | |
111 | |
107 | |
95 |