Have you ever wished you could see what your data looked like last Tuesday? With time travel in Microsoft Fabric Warehouse, you can!

Time travel in Microsoft Fabric Warehouse provides the ability to query your data exactly as it existed at any point within the last 30 days, without maintaining separate historical snapshots or copies.

Fabric Warehouse is built on Delta Lake, which records every insert, update, and delete as a new version in the Delta Log rather than overwriting data in place. This means in the background the warehouse maintains a complete version history of your data from the moment it was created, up to a rolling 30-day retention window.

 

The T-SQL Syntax

Time travel uses the OPTION clause with a FOR TIMESTAMP AS OF hint. The timestamp must be provided in UTC, formatted as YYYY-MM-DD HH:MM:SS[.fff]. For example, to query a single table as it existed at a specific point in time:

SELECT *
FROM Dim.Customer
OPTION (FOR TIMESTAMP AS OF '2026-05-05 09:00:00.000')

Note: the OPTION clause applies to the entire statement, so if you’re joining multiple tables, they’re all evaluated at the same point in time. This makes multi-table queries straightforward:

SELECT
c.CustomerName
,SUM(s.Value) AS HistoricalValue
FROM Fact.Sale s
JOIN Dim.Customer c ON c.CustomerKey = s.CustomerKey
GROUP BY c.CustomerName
OPTION (FOR TIMESTAMP AS OF '2026-05-05 09:00:00.000')

 

Useful Tip: Comparing current vs historical data

Because the OPTION clause applies to the entire query, you can’t compare “now” against “then” in a single statement. But, you can use the time travel feature in DML-like operations such as INSERT INTO…SELECT, CREATE TABLE AS SELECT (CTAS), and SELECT INTO. So if you need a before/after comparison, you can materialise each snapshot separately first:

Step 1 – snapshot the historical state

SELECT * INTO Dim.Customer_before
FROM Dim.Customer
OPTION (FOR TIMESTAMP AS OF '2026-05-05 09:00:00.000')

Step 2 – then compare against current data

SELECT
c.CustomerKey
,c.CustomerName AS CustomerName
,c.Email AS current_value
,b.Email AS historical_value
FROM Dim.Customer c
JOIN Dim.Customer_before b ON b.CustomerKey = c.CustomerKey
WHERE c.Email <> b.Email

 

Practical Use Cases

Here are some scenarios where you could use time travel:

  • Incident investigation and data recovery: query the pre-incident state and recover affected rows without touching a backup
  • Audit and compliance: show exactly what the data contained at a given moment, without relying on application-level logs
  • Pipeline debugging: compare before and after a pipeline run to figure out if it’s a data problem or a logic problem

 

Limitations

Here are some limitations with the time travel feature:

  • Time travel is limited to 30 days
  • Schema changes reset the clock, if a table’s schema has been modified (columns added, removed, etc.), you can only time travel back as far as that change, any history before the change is inaccessible
  • There is no time zone conversion built into the syntax, so all timestamps must be in UTC

 

Summary

Time travel in Fabric Warehouse is a low-overhead capability that covers a wide range of operational scenarios. It costs nothing to enable, and because the version history is maintained automatically and requires no schema changes or additional storage, it is a useful feature to have when the need arises.

Tags: , ,