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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ukaufman
Frequent Visitor

Substract datetime

Hi! I am trying to substract each row with the previous one at the same column. 

For example I need to substract the row 473 of "fecha_reporte_API" from the row 472 and so on. 

Is there any way of doing this?

Thanks! 

 

 

doubt2.jpg

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @ukaufman 

 

Please see the attached file with the solution, all you need to do is add an index column and later a custom column.

For reference please see Added Custom step on the attached 

 

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @ukaufman 

 

Please see the attached file with the solution, all you need to do is add an index column and later a custom column.

For reference please see Added Custom step on the attached 

 

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

v-juanli-msft
Community Support
Community Support

Hi @ukaufman 

You can create calculated columns in Data view easily.

Capture15.JPG

 

Column = CALCULATE(LASTNONBLANK(Sheet3[fecha api],0),FILTER(Sheet3,Sheet3[fecha api]<EARLIER(Sheet3[fecha api])))

Column 2 = DATEDIFF([Column],[fecha api],SECOND)

 

 

Your  "fecha_reporte_API" repeats for many rows, what is your expected result for the same "fecha_reporte_API"?

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

ddf

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.