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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AshlerK
Regular Visitor

Trying to Find Difference Between Two Times in Minutes

Hope I can make this clear, am a somewhat intermediate user, can make DAX formulas work after some trial and error. Need some assistance on a formula to calculate a difference in minutes between two calculated columns that are both from different tables.

 

Each column was calculated for it's own table so that I could find the average of lateminutes per vehicle_name category. This was to discover lateness in minutes at two different locations and then find the difference to learn the gained lateness from location 1 and 3. I have the two calculated columns doing exactly what I need for each table, and they display properly on the visual matrix.

 

Now I need to add a way to visualize the difference betweeb both columns when organized per vehicle_name. 

 

AshlerK_0-1652101970295.png

To help with the visual, vehicles come down the line reducing the location checkpoints until they hit LOC1. Trying to figure out difference in lateness for when it hits LOC3 and then continues travel to LOC1

 

Calculated Column formulas look like this per table:

 

Location 1 Table Calculated Column: 

LOC1 AVG LateMinutes = CALCULATE (AVERAGE ('LOC1 Vehicle Lateness'[LateMinutes]), ALLEXCEPT ('LOC1 Vehicle Lateness''LOC1 Vehicle Lateness'[VEHICLE_NAME]))
 
Location 3 Table Calculated Column:
LOC3 AVG LateMinutes = CALCULATE (AVERAGE ('LOC3 Vehicle Lateness'[LateMinutes]), ALLEXCEPT('LOC3 Vehicle Lateness','LOC3 Vehicle Lateness'[VEHICLE_NAME]))
1 ACCEPTED SOLUTION

In that case try assigning column names while creating the calculated table

rohit_singh_0-1652106611366.png

If that still doesn't work could you please share the sample data?

View solution in original post

6 REPLIES 6
rohit_singh
Solution Sage
Solution Sage

rohit_singh_1-1652103517596.png

 

Create a calculated table as shown above. Add a calculated column that computes the difference between LOC1 and LOC3

Hello! Thank you for your time! This formula you have written for the calculated tbale is giving me an error. Specifically, it isn't retrieving the LOC3 AVG LateMinutes column from the second table. I am unsure why, it is able to pull all the data from the first table, but not the table I imported for LOC3. 

To give additional detail, even when I form a UNION between the two tables, the CP3 column does not show. I am unsure why. Perhaps because it is such a similiar formula that when combined they are viewing the same data?

 

AshlerK_0-1652104227107.png

 

Please make sure there is an active relationship between the two tables similar to below

rohit_singh_0-1652104359717.png

 

I have assured they are tied by their Vehicle_Name as well! I edited my above reply, the issue seems to be, in my calculated table, the LOC1 and LOC3 columns combine into 1 column. 

 

AshlerK_0-1652104611685.png

 

In that case try assigning column names while creating the calculated table

rohit_singh_0-1652106611366.png

If that still doesn't work could you please share the sample data?

I appreciate the help and "hand-holding" immensely. Thank you very much, it works!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.