Power BI can't restore a SQL view by itself. It has no button that recreates a dropped or broken view on your SQL Server, and it never stores the view's definition in a form you can push back. What Power BI can do is surface the failure fast, confirm that the view is back to returning the right columns and rows, and in narrow cases drive restoration of related objects that feed the view. The actual restore happens in SQL Server Management Studio (SSMS), Azure Data Studio, or sqlcmd, using a saved script or source-control history. The reliable workflow pairs those tools: detect the break in Power BI, restore the view in SQL, then validate in Power BI before republishing.

This guide covers both repair paths, rebuilding the view itself and restoring objects the view depends on, plus the specific reasons a "restore" through Power BI fails.

What Power BI can and cannot restore in a SQL view

Power BI's relationship with a SQL view is read-only. Import mode stores a compressed snapshot of whatever the view returned the last time it refreshed. DirectQuery sends a query to the database each time a visual needs data. Live connection to an Analysis Services model doesn't touch the SQL view at all.

That read-only design means three things follow directly:

A dropped view breaks the next refresh or the next DirectQuery visual load, and Power BI reports the error rather than repairing it. The stored snapshot in Import mode keeps old numbers on screen until a refresh fails. The report can look healthy while its source is gone, which is why a refresh cadence matters. Power BI's metadata for the view is thin: server, database, schema, object name, and the column names and types it saw on import. No view text, no indexes, no permissions.

So the honest scope is detection, diagnosis, verification, and one limited recovery case covered later: building tables from a view's query in Power Query, which only helps if the view's logic still exists somewhere.

Before you start: what you actually need to restore a view

Gather these before touching anything, because a restore usually fails on missing prerequisites rather than missing skill.

1: The view definition. Find it with sp_helptext 'schema.YourView', Object Explorer in SSMS, sys.sql_modules, or your source-control history. If the view is already dropped, the definition has to come from a backup, a deployment script, or version control. 2: Database permissions. Restoring a view needs ALTER (to replace an existing view) or CREATE VIEW (to recreate a dropped one) on the schema, plus SELECT on the underlying objects. In most production setups that means elevated rights you may not hold. 3: A trustworthy environment to restore into first. Prefer a development or staging copy, not the database a live report depends on. 4: Ownership context. Confirm which login or user owns the view and its schema. Ownership chains affect what downstream reports can read after the restore. 5: The Power BI side. Note whether the report uses Import or DirectQuery, the workspace and dataset, how credentials are configured for the gateway, and the last successful refresh time. This is your baseline for verification.

If you don't have the view definition and can't reconstruct it, stop and recover it from backup first. No Power BI trick substitutes for the missing script.

Step 1: Confirm and diagnose the broken view from Power BI

The symptom is usually one of three messages: a refresh failure citing "invalid object name" or a missing object, a DirectQuery visual showing a database error, or stale Import-mode numbers with a failed refresh in the history.

Work through reversible checks first.

1: Open the dataset's refresh history in the workspace and read the full error text. "Could not find object" or "Invalid object name 'schema.ViewName'" points at the view itself. A permission error points at login rights. A timeout points at performance, not a missing object. 2: Open Power Query Editor and look at the source step for the table. If the navigation step lists the view but the preview fails, the view is likely gone or renamed. If the preview works but a later step fails, the view returns different columns than the report expects. 3: In SQL, run a plain SELECT TOP 10 * FROM schema.YourView in the same database and with the same credentials the report uses. If it fails there, the problem is in the database, not Power BI. 4: Check whether a recent deployment renamed the schema, dropped and recreated the view with different column names, or altered its output. A view that exists but returns a renamed column produces a schema mismatch error rather than a missing-object error, and the fix differs.

A specific stop condition: if the error is a permissions or login failure on a shared production gateway, or if you lack database rights to run diagnostic queries, hand the ticket to the database administrator. Changing gateway credentials to work around a permissions problem can break other reports.

Step 2: Restore the view in SQL Server, not through Power BI

This is where the actual restoration happens. The procedure is the same whether you're repairing from SSMS, Azure Data Studio, or a migration script.

1: Restore into a development database first. Run the view definition there with CREATE VIEW (if it was dropped) or ALTER VIEW (if you're replacing a broken version). Preserve the original schema name, column order, and column names, because the report's queries and relationships depend on them. 2: Match the original definition. Compare against the saved script or the output of sp_helptext from backup. Pay attention to WITH SCHEMABINDING (which blocks changes to underlying columns), the owner, and any indexed-view requirements if the original was schemabound. 3: Restore dependencies first. Most view failures are really dependency failures. If the view references tables or other views that were dropped or altered, restore those in order before the view itself. sp_refreshview or a quick test SELECT against the view will surface the next missing object. 4: Test the exact shape. Run a query selecting the same columns the report imported, with a row count and a few sample values. Column renames, type changes, and dropped columns are the errors that break Power BI even when the view "works." 5: Promote to production. Run the same script against production after a change window. Confirm the view compiles and returns rows with the service account the report uses. 6: Restore permissions. Reapply grants if the view was recreated. A recreated object loses the existing permissions, and the next refresh will fail with a login error that looks unrelated.

The check for success at this stage: SELECT against the view in production succeeds with the expected column list, and the report's credentials can read it. If either fails, fix it in SQL before moving back to Power BI.

Step 3: Refresh and repoint the Power BI dataset

Once the view is back, Power BI needs a refresh, and sometimes a nudge.

1: Open the dataset settings and check the data source credentials. If the view was recreated and permissions changed, re-enter the credentials or confirm the gateway's service account still works. 2: Run a manual refresh from the workspace or Power BI Desktop and read the result. A successful refresh with no schema warnings means the column shape matched. 3: If the refresh fails with a schema mismatch, return to Power Query Editor and inspect the changed columns. Either the view's column names changed or a column type shifted. Fix on the SQL side to match the report if the report can't be touched, or update Power Query and republish if the report is allowed to change. 4: For DirectQuery reports, no refresh is required, but open a visual to confirm the query now runs. If the view was replaced with a different column set, the visuals will fail until Power BI's model matches. 5: Republish or update the app if you changed anything in the model. Users won't see the fix until the published version is updated.

Verification on the Power BI side: compare a known row count or a fixed aggregation (a specific month's total, a single-key lookup) between the view and the report. Numbers should match exactly. If the view returns more rows after a restore, your report includes the extra rows, and that difference is worth a note in the ticket.

Step 4: Handle the schema drift that breaks reports after a restore

A view can be restored "correctly" and still break the report, because restoration often happens from a slightly different version. The common failures are a renamed column, a changed data type (a datetime becoming datetime2, say), a dropped column, a changed collation, and a changed row count from a restored underlying table.

The practical fixes, in order of preference:

Restore the view to the original shape when the report must not change. Use column aliases in the view definition to keep names stable: SELECT OldDateColumn AS DateKey. Aliases absorb many harmless changes on the underlying table. Update Power Query and the model when the report can change. Adjust the step, re-add relationships, and check measures that reference the renamed field. Keep column order stable if anything depends on positional loading. Power BI's own navigation import usually matches by name, but hand-edited queries and some connectors can be order-sensitive.

I recommend restoring to the original shape when the report is published broadly and you can't coordinate a redeploy with every consumer. Changing the report to match a new view shape means republishing and re-verifying every visual.

How Power BI helps in the one case where it does perform a restore

There's a narrow scenario where Power BI can rebuild something from a view: when the view's logic still exists as a query, you can turn that query into a table in Power Query, or load the view's results into a table. That's not restoring the view, but it preserves access to the data while the database side is fixed.

The procedure: open Power Query, duplicate the step that queries the view, and either use its M query as the basis for a new data source or use the view's SELECT text in a new table that you materialize in the database. The view's logic has to be visible somewhere for this to work: Power Query's native views show the view as a navigation step, not the SELECT text, so this only helps when the definition is stored separately, such as a checked-in SQL file or a view that wraps a simpler query.

Be clear about what this doesn't do: it doesn't recreate the object in SQL Server, doesn't restore permissions, and doesn't help DirectQuery, which needs a real object in the database. It's a stopgap to keep a report running while the database fix proceeds.

Common failure scenarios and what they actually mean

The view was dropped by a deployment that forgot it. Check the deployment script history. Restoring means re-running the view definition and adding it to the deployment set so it doesn't vanish again.

The view depends on a table that was dropped. The view may exist but fail when queried. sp_refreshview will error with the specific missing reference. Restore the table first.

The view was altered to return a subset of rows. The report refreshes successfully but shows fewer records. Nothing is broken; the view's logic changed. Restore the previous definition or reconcile the filter with the report owner.

Permissions were lost on recreate. The refresh fails with a login error even though the view works under your login. Reapply grants and verify with the report's service account.

The view works in SSMS but not in Power BI. Usually a credential or gateway issue, sometimes a schema mismatch on a column the preview didn't show. Test with the same login the gateway uses.

A DirectQuery report fails after a successful SQL restore. The model's column metadata is stale. Republish the model after confirming the view's shape.

Each of these is a database-side fix, which reinforces the core point: Power BI is the smoke alarm, not the fire extinguisher.

Restoring a view safely on a published report

A few practices make this smoother if it happens again.

1: Keep view definitions in source control. The single biggest time saver is having the CREATE VIEW script checked in so a drop is a re-run, not an archaeology project. 2: Keep a known-good refresh baseline. Note the column list and a sample aggregation after each healthy refresh. Comparison takes minutes. 3: Script permissions alongside the view. Store grants in the same source file so a recreate doesn't silently lose access. 4: Test in a copy of the database first. Restoring into production directly risks breaking other reports that share the view. 5: Use a refresh cadence that surfaces failures. Daily refresh on the affected dataset means a broken view shows up in the refresh history the next morning, not when a consumer complains.

Success check for the whole workflow: the view exists in SQL with the right shape and permissions, the Power BI refresh completes with no schema warnings, and a spot-checked number matches between the database and the report. If any of those three fails, you haven't finished.

A final note on tooling versions: the steps here rely on stable features present in SSMS, Azure Data Studio, and Power BI Desktop at the reference date of November 13, 2026. Menu names shift between releases, but the underlying workflow, restore in SQL, validate in Power BI, holds regardless of the version you're running.