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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
icturion
Resolver II
Resolver II

Calculate difference between two date/time values

Hi,

 

I have two columns with time stamps. 

first i create a measure for echa column thats calculates the average time:

Measure = FORMAT(AVERAGE(AQZ_TRAVEL_MON[Tijd_Begin]);"HH:MM: SS")
 
Now i want to calculate the time differents between the to measures. can some one help me with that?
 
Kind regards
Icturion
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try this:

measure differents = FORMAT('Table'[measure 1] - Table[measure 2];"HH:MM: SS")

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@icturion - Your measures are formatting as text. Remove the formatting, do the calculation, and apply the formatting after that.

Hope this helps,

Nathan

Hoi @Anonymous 

 

measure 1 = AVERAGE(Column_x[start_time])

measure 2 = AVERAGE(Column_y[stop_time])

 

measure differents = FORMAT(SUMX('Table';'Table'[measure 1]- (Table[measure 2])));"HH:MM: SS")

 

The last measure generates a systax error. if i remove the format option the systax error is gone. 

 

But the result in the right column is not correct. differents between record one and two can not be so different (see picture)

 

Knipsel.JPG

 

Kind regards,

ICturion

Anonymous
Not applicable

Why are you using SUMX to find the difference?

datadiff and datebetween don't work, so I tried sumx. which would you recommend?

Anonymous
Not applicable

Try this:

measure differents = FORMAT('Table'[measure 1] - Table[measure 2];"HH:MM: SS")

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.