When working with data, mistakes, unexpected changes, and “what was it like before?” questions are pretty common. That’s where Microsoft Fabric’s time travel feature steps in. Think of it like a rewind button for your data tables.
Originally built into Fabric Warehouses, time travel in Lakehouse now gives users an even more flexible way to look back at how data used to be. With built-in support from Spark, Microsoft lets you access earlier snapshots of a table — no backups, no manual versioning.
Need to recover from a wrong update? Want to audit historical values? Or compare a report from last week with today’s numbers? Instead of rebuilding or reloading data, you just add a timestamp or version number to your query — and that’s it.
This blog walks through how to use this feature step by step. It not only saves time but also cuts down human errors and simplifies debugging. Data pros and teams can now handle time-based queries with way less effort and way more accuracy.
Setting Up Microsoft Fabric for Time Travel 1. Accessing Fabric Workspace To begin, head over to app.powerbi.com. From there:
Choose your workspace (e.g., GA10 Fabric Workspace). Filter the content type to Lakehouses. Open your target Lakehouse (e.g., Lake 02). 2. Exploring the Target Table Use the Lakehouse Explorer to view tables. The table used for this example is Sales_Delta. Right-click the table and select “View files”. You’ll notice multiple files representing different versions created during each update. Steps to Check the Latest Data Snapshot Before you start exploring older versions of your data , it’s important to first understand what the current state looks like. This gives you a point of reference. You’ll use this snapshot later when comparing results from different timestamps or versions.
1. Query via SQL Analytics Endpoint To check the current totals in the Sales_Delta table, go to the SQL Analytics endpoint and run a simple aggregation query like this:
This query returns two key values:
Total quantity of all items in the table. Gross value is calculated by multiplying quantity by price.
These figures help confirm the current data in its most up-to-date form — essentially your “version now” numbers. You’ll be using these same fields in later queries, so knowing their baseline values up front helps make sure time travel queries are working as expected.
2. Referencing GitHub Sales Data If you’re following along and want to run the same tests, the exact Sales_Delta dataset used in this example is available on GitHub. You can download it and load it into your own Lakehouse or Warehouse environment, so your results will match what’s shown in this blog.
Steps to Run First PySpark Command for Microsoft Fabric Time Travel Once you’ve seen your current data snapshot, the next step is to work within a notebook to start running time travel queries. This part happens using Spark, which powers the ability to query different versions of your table.
1. Start the Spark Session To begin, open or create a new notebook in Microsoft Fabric . This notebook is where you’ll run PySpark or Spark SQL commands that access historical versions of your table.
Here’s what to do:
Open a notebook : Either create a new one or reuse one you’ve already worked with. Connect it to your Lakehouse : Make sure the notebook is pointing to the same Lakehouse (e.g., Lake 02) that contains your Sales_Delta table. Drag in the table : When you drag the Sales_Delta table into the notebook, Fabric will auto-generate a starter code that helps you quickly reference the table in your PySpark session. Start the Spark session : Running any command will trigger the Spark engine to start. This lets you run distributed queries and access features like time travel. Example code to run:
This will return a sample of 1,000 rows from your table. It confirms that the table is accessible and lets you check the structure and sample values before running deeper queries.
2. Switch Between PySpark and SQL Not everyone prefers PySpark — and that’s okay. You can use SQL-style queries even inside your notebook.
Just add %%sql at the top of a cell to switch it to SQL mode. This is useful if you’re more comfortable writing SQL than Python code. It also helps when you want to copy-paste commands like DESCRIBE HISTORY or RESTORE TABLE, which are easier in SQL syntax.
This flexibility means you can run the same logic using the language you’re most comfortable with — and switch back and forth whenever needed .
How to Look at Table History in Microsoft Fabric for Time Travel Before you do anything with past data, it’s helpful to first see what versions even exist. Microsoft Fabric tracks each change to your Delta table and logs it as a version, which includes the operation type (like update, restore), timestamps, and user info.
Use DESCRIBE HISTORY
To view this log of past changes, run the following SQL command:
This shows a full history of your table, including:
Type of operation (UPDATE, RESTORE, etc.)
You’ll refer to this table often — especially when you want to query older states of the data or restore a specific version.
Performing Updates & Triggering New Versions Now that you’ve seen your table’s version history, let’s create a new version on purpose — by updating some data.
1. Update Records Conditionally You can simulate a data update by changing values in a controlled way:
This command updates all rows where quantity equals 1, changing them to 5. Once you do this, Fabric automatically logs this as a new version (e.g., version 3).
This is how Fabric tracks every change you make — no manual version control is needed.
2. Re-check History After the update, run the history command again:
You should see a new row at the top of the output with the latest version. This confirms the update was logged and is now part of your table’s change history.
How Time Travel Works Under the Hood To make time travel possible, Microsoft Fabric uses Delta Lake under the surface — an open-source storage layer built on top of Parquet files. Every time you update, insert, delete, or restore data, Fabric doesn’t overwrite anything. Instead, it:
Writes a new version of the data behind the scenes. Adds metadata and logs the change in a transaction log (stored as JSON files). Preserves earlier versions, so they can be accessed later using a timestamp or version number.
That’s why you see new data files appear in your Lakehouse Explorer after each update — they’re not replacing the old ones; they’re being added to the version history.
This setup gives you:
Zero manual backups — versioning happens automatically. Consistent reads — even if data is being updated, you can query a clean snapshot from the past. Efficient rollbacks — just one line of SQL to undo major changes.
So, when you run a TIMESTAMP AS OF or VERSION AS OF query, Fabric knows exactly where to look in the log and which data files to pull together — giving you a full view of what things looked like at that point in time.
Microsoft Fabric Vs Tableau: Choosing the Best Data Analytics Tool A detailed comparison of Microsoft Fabric and Tableau, highlighting their unique features and benefits to help enterprises determine the best data analytics tool for their needs.
Learn More
Querying Historical Data by Timestamp Let’s say you want to look at what the table looked like before that last update. Instead of manually restoring anything, you can query the past using a timestamp.
Use TIMESTAMP AS OF
This query returns the data as it existed at that specific moment in time. It’s useful for:
Comparing values across points in time
Just copy the timestamp from your DESCRIBE HISTORY output and plug it in here.
Querying Data by Version Instead of Time Timestamps can get tricky to manage . If you know the exact version you want, use version numbers instead.
Use VERSION AS OF
This gives you the same result as querying by timestamp, but it’s easier when you track version numbers directly from the history log.
How to Access Version History via PySpark If you prefer working in PySpark or want to automate some of these steps in code, you can access all the same history and query features there too.
1. Get Version History Programmatically This returns the full version history of the table, just like the SQL DESCRIBE HISTORY command.
2. Read Data by Timestamp Use this if you want to pull in data from a specific moment in time.
3. Read Data by Version Use this if you know the version number and want the data from that snapshot.
Optimize Your Data Strategy with Intelligent Analytics Solutions! Partner with Kanerika Today.
Book a Meeting
Restoring Previous Versions in Microsoft Fabric Time travel isn’t just about looking — you can also roll back. If a version of your data looks better than the current one, you can restore it to the new latest state.
Use the Restore Command
This command brings your table back to version 0, and automatically logs a new version (e.g., version 4) showing the restore action.
There is no need to delete or manually overwrite anything — just restore and Fabric takes care of the rest.
Checking Delta Log and File Changes Behind the scenes, every version and update creates new files in your Lakehouse.
Inspect File Changes
Right-click on Sales_Delta and choose View files → then hit Refresh. You’ll see new .parquet, .json, and log files generated for each version.
This lets you visually confirm that changes are tracked on the file system too — not just through queries.
Kanerika: Your Expert Partner for Microsoft Fabric Success Kanerika is a leading provider of data and AI solutions, specializing in maximizing the power of Microsoft Fabric for businesses. With our deep expertise, we help organizations seamlessly integrate Microsoft Fabric into their data workflows, enabling them to gain valuable insights, optimize operations, and make data-driven decisions faster.
As a certified Microsoft Data and AI solutions partner , Kanerika leverages the unified features of Microsoft Fabric to create tailored solutions that transform raw data into actionable business insights.
By adopting Microsoft Fabric early in the process, businesses across various industries have achieved real results. Kanerika’s hands-on experience with the platform has helped companies accelerate their digital transformation , boost efficiency, and uncover new opportunities for growth.
Partner with Kanerika today to elevate your data capabilities and take your analytics to the next level with Microsoft Fabric!
Frequently Asked Questions What is time travel in MS fabric? In Microsoft Fabric, the capability to time travel unlocks the ability to query the prior versions of data without the need to generate multiple data copies, saving on storage costs.
What is time travel of data? The ability to query data from a specific timestamp is known in the data warehousing industry as time travel. Time travel facilitates stable reporting by maintaining the consistency and accuracy of data over time.
What happens to deleted or modified records during the Time Travel retention period? During the Time Travel retention period, modified or deleted records are preserved, allowing for data recovery and querying of historical data, and after the period ends, they are moved to Fail-safe for further protection.