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! Request now

Reply
Anonymous
Not applicable

Subtraction of 2 time rows

Hello all,

 

I have a "Tarih.2 (hour:minute:sec)" column in my database and I want to subtract each pair of values in this column.

For example; row2-row1, row4-row3, row6-row5 etc..

After this operation, I need keeps these values into new column.

 

How can I do this? 

 

ernu_0-1635942324684.png

 

Thanks a lot in advance.

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

So, with your table in Power Query, you would select the [Index.1] column, then go to the Home tab and select Merge.

In the dialog, you would use the same table for both the left and right members of the merge i.e. you are joining/merging the table on itself:

BA_Pete_0-1636015638170.png

 

When the merge completes, you will have a column full of nested tables. Expand these tables by hitting this button:

BA_Pete_1-1636015728602.png

 

And select just your [Tarih.2] column from the list:

BA_Pete_2-1636015794157.png

 

This should give you a table like this where the previous [Tarih.2] value is on the same row as the current value:

BA_Pete_3-1636015903742.png

 

This now makes it really easy to do comparisons of the two values on each row.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @BA_Pete ,

 

Actually, I couldn't fully understand. Can you explain as more detail?

 

Thanks a lot,

Eren

Hi @ernu ,

 

So, with your table in Power Query, you would select the [Index.1] column, then go to the Home tab and select Merge.

In the dialog, you would use the same table for both the left and right members of the merge i.e. you are joining/merging the table on itself:

BA_Pete_0-1636015638170.png

 

When the merge completes, you will have a column full of nested tables. Expand these tables by hitting this button:

BA_Pete_1-1636015728602.png

 

And select just your [Tarih.2] column from the list:

BA_Pete_2-1636015794157.png

 

This should give you a table like this where the previous [Tarih.2] value is on the same row as the current value:

BA_Pete_3-1636015903742.png

 

This now makes it really easy to do comparisons of the two values on each row.

 

Pete

Hi @Anonymous ,

 

So, with your table in Power Query, you would select the [Index.1] column, then go to the Home tab and select Merge.

In the dialog, you would use the same table for both the left and right members of the merge i.e. you are joining/merging the table on itself:

BA_Pete_0-1636015638170.png

 

When the merge completes, you will have a column full of nested tables. Expand these tables by hitting this button:

BA_Pete_1-1636015728602.png

 

And select just your [Tarih.2] column from the list:

BA_Pete_2-1636015794157.png

 

This should give you a table like this where the previous [Tarih.2] value is on the same row as the current value:

BA_Pete_3-1636015903742.png

 

This now makes it really easy to do comparisons of the two values on each row.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi @Anonymous ,

 

It looks like you're already halfway through the solution I would propose in that you've got two index columns offset by 1.

I would merge your table on itself as table[Index.1] = table[Index] and expand the [Tarih.2] column after the merge.

You then have the two times inline on the same row to make the subtraction on using Duration functions or whatever method you choose.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.