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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
aez97
New Member

DAX help

Hi everyone, im fairly new to working with DAX and i am in need of some help with a formula. i have drivers information such as driver id, start time, completion time, and trip time. I have the trip time in minutes for every trip a drivers has done but the issue is i want to add the trip time a driver has done in a single day rather than having it seperated by trips. For an example, if i was a driver and completed 5 trips on 4/5/2024 that took 30 minutes each, i want this column to return 150. i have tried this formula but it only returned blank 

CALCULATE(
    SUM(OnFleet_Export4_1[trip time]),
    FILTER(
        OnFleet_Export4_1,
        OnFleet_Export4_1[DriverID 2] = SELECTEDVALUE(OnFleet_Export4_1[DriverID 2]) &&
        OnFleet_Export4_1[StartDate] = SELECTEDVALUE(OnFleet_Export4_1[StartDate])
    )
)

 

 

 

Thank you for your help 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @aez97 ,

@lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:  

I create a table as you mentioned.

vyilongmsft_0-1712541432398.png

Then I do some changes on your DAX code and it gives me what you want.

Measure = 
VAR _A =
    SUM(OnFleet_Export4_1[trip time])
RETURN
    _A * 30

vyilongmsft_1-1712541686901.png

 

 

 

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.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @aez97 ,

@lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:  

I create a table as you mentioned.

vyilongmsft_0-1712541432398.png

Then I do some changes on your DAX code and it gives me what you want.

Measure = 
VAR _A =
    SUM(OnFleet_Export4_1[trip time])
RETURN
    _A * 30

vyilongmsft_1-1712541686901.png

 

 

 

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.

aez97
New Member

it's more of local deliveries so they shouldn't be crossing timezones and the work hours aren't overnight so the drivers aren't out that time of the day @lbendlin 

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

lbendlin
Super User
Super User

What if they are driving through the night, or are crossing timezones?  Are your timestamps in UTC?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.